bash question

Jerry Feldman gaf-mNDKBlG2WHs at public.gmane.org
Sun Jan 4 07:49:22 EST 2009


On 01/04/2009 12:11 AM, Ben Eisenbraun wrote:
> On Sat, Jan 03, 2009 at 06:00:04PM -0500, dan moylan wrote:
>  =20
>> ben eisenbraun writes:
>>    =20
>>> What was the error?
>>>      =20
>> error was [: 71: Bad substitution
>>    =20
>
> What is on line 71?  That doesn't look like the example script you=20
> posted originally.
> =20
>  =20
>>> It works fine for me on:
>>> GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0)
>>> GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
>>>      =20
>> yeah, works fine for me too under bash, just not in .profile
>> for login.
>>    =20
>
> .profile is not a shell.  I don't think the file has anything to do wit=
h
> it.  Either bash is your login shell or it isn't.
>
> bene at beacon:~$ cat .profile
> HST=3Dfoobar
> hst=3D${HST:0:3}
>
> (logout, login again, no error)
>
> bene at beacon:~$ lsb_release -d
> Description:    Ubuntu 8.10
> bene at beacon:~$ echo $HST
> foobar
> bene at beacon:~$ echo $hst
> foo
> bene at beacon:~$ echo $BASH
> /bin/bash
> bene at beacon:~$ echo $BASH_VERSION=20
> 3.2.39(1)-release
>
> So if it's not working, then you're not running bash.  This seems to be=
=20
> the conclusion you've come to in later emails.
>  =20
Question for Dan,
What happens if you run a terminal (eg GNOME Terminal) as a login=20
shell.  Normally terminals are set by default not to be a login shell.=20
Also, did you check the contents of your ~/.xsession-errors


--=20
Jerry Feldman <gaf-mNDKBlG2WHs at public.gmane.org>
Boston Linux and Unix
PGP key id: 537C5846
PGP Key fingerprint: 3D1B 8377 A3C0 A5F2 ECBB  CA3B 4607 4319 537C 5846







More information about the Discuss mailing list