bash question

Ben Eisenbraun bene-Gk2boCrsRs1AfugRpC6u6w at public.gmane.org
Sun Jan 4 00:11:11 EST 2009


On Sat, Jan 03, 2009 at 06:00:04PM -0500, dan moylan wrote:
> ben eisenbraun writes:
> > What was the error?
> 
> error was [: 71: Bad substitution

What is on line 71?  That doesn't look like the example script you 
posted originally.
 
> > 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)
> 
> yeah, works fine for me too under bash, just not in .profile
> for login.

.profile is not a shell.  I don't think the file has anything to do with
it.  Either bash is your login shell or it isn't.

bene at beacon:~$ cat .profile
HST=foobar
hst=${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 
3.2.39(1)-release

So if it's not working, then you're not running bash.  This seems to be 
the conclusion you've come to in later emails.

-ben

--
the roots of education are bitter, but the fruit is sweet.
                                               <aristotle>





More information about the Discuss mailing list