On 02/26/2013 02:03 AM, Linda Walsh wrote:
My login shell is /bin/bash (i.e. not /bin/sh); SHELL=/bin/bash as well.
Typing 'which bash' gives /bin/bash, and whence bash: bash is /bin/bash.
which is not always correct. Use type builtin.
I had the foll0wing script which acts differently based on
On Tue, Feb 26, 2013 at 11:22 AM, Roman Rakus wrote:
> On 02/26/2013 02:03 AM, Linda Walsh wrote:
>>
>> My login shell is /bin/bash (i.e. not /bin/sh); SHELL=/bin/bash as well.
>> Typing 'which bash' gives /bin/bash, and whence bash: bash is /bin/bash.
>
> which is not always correct. Use type bui
On 2/26/13 12:41 AM, Linda Walsh wrote:
> It isn't using the current value of SHELL as my shell nor the value
> of my login shell.
It uses $0 (or, rather, the basename of $0), which is initialized from
the parent shell's argv[0]. What is $0 set to?
>
> It is forcing interpretation
Chet Ramey wrote:
> On 2/26/13 12:41 AM, Linda Walsh wrote:
>
>> It isn't using the current value of SHELL as my shell nor the value
>> of my login shell.
>
> It uses $0 (or, rather, the basename of $0), which is initialized from
> the parent shell's argv[0]. What is $0 set to?
"-bash"
POSIX specifies the behavior of a shell. This tells Chet how he has to
make Bash behave (with some leeway). There are all kinds of silly little
details and ambiguities that Chet has to worry about.
However, YOU as a shell script writer do not have to worry about all
that crap. All you have to d
Greg Wooledge wrote:
> POSIX specifies the behavior of a shell. This tells Chet how he has to
> make Bash behave (with some leeway). There are all kinds of silly little
> details and ambiguities that Chet has to worry about.
>
> However, YOU as a shell script writer do not have to worry about
On Tue, Feb 26, 2013 at 01:27:35PM -0800, Linda Walsh wrote:
> Except it isn't a script -- it's input that came from
> the terminal, that got repetitively edited using vi mode, until it got
> saved in a file so it could continue to be edited, and stay on the screen
> while executing it in the
On 2/26/13 3:39 PM, Linda Walsh wrote:
>
>
> Chet Ramey wrote:
>> On 2/26/13 12:41 AM, Linda Walsh wrote:
>>
>>> It isn't using the current value of SHELL as my shell nor the value
>>> of my login shell.
None of this is relevant, see below.
> #if 1 <-
On Sunday, February 24, 2013 10:26:52 PM Thorsten Glaser wrote:
> Dan Douglas dixit:
>
> >Zsh and pdkshes produce:
> >
> >one:::two:three:::four
> >
> >For all of the above, which I think is wrong for the last 4. ksh93
> >produces:
>
> Why is it incorrect?
This test was intended to demonstrate e