Question about the -c option
Hi everybody,
I'm puzzled about the different result of the following approaches:
# Cannot work
$ bash -c "read n; echo $n"
/* Can work */
execl ("/bin/sh", "sh", "-c", "read n; echo $n", 0);
Why they are different?
Does the option "-c" means noninteractive?
What on earth does noninteractive mean?
Re: Question about the -c option
On Mon, 07 Jan 2008 11:37:02 +0800, Richard W <mail4usenet [at] gmail.com> wrote:
>Hi everybody,
>
> I'm puzzled about the different result of the following approaches:
>
> # Cannot work
> $ bash -c "read n; echo $n"
Try single quotes: ~$ bash -c 'read n; echo $n'
Grant.
--
http://bugsplatter.mine.nu/
Re: Question about the -c option
Grant дµÀ:
> On Mon, 07 Jan 2008 11:37:02 +0800, Richard W <mail4usenet [at] gmail.com> wrote:
>
>> Hi everybody,
>>
>> I'm puzzled about the different result of the following approaches:
>>
>> # Cannot work
>> $ bash -c "read n; echo $n"
>
> Try single quotes: ~$ bash -c 'read n; echo $n'
>
> Grant.
Thank you very much!