Bash Shell script problem after upgrade

Nils Kassube kassube at gmx.net
Mon Jan 3 17:08:59 UTC 2011


Linda wrote:
> I have bash shell scripts that ran under LTS 8.04 and no longer work.
> They still ask the questions for the variables but the output file
> is not created. I have tried to keep the bones of the script and
> have gotten rid of most of the content that is echoed to the file. I
> tried commenting out the lpr command and the file is not created.
> Why would this file that has worked since the 1980s no longer create
> a file with LTS 10.04. Thanks
>                Linda
> 
> # Rprice_ prints price list
> #!/bin/bash

Not sure if these two lines are the only problem but at least the 
sequence is wrong. The "#!/bin/bash" line should be the first one to 
select bash instead of sh. IIRC, in 8.04 /bin/sh was still linked to 
/bin/bash and therefore your script used bash because it was the default 
anyway. In later Ubuntu versions /bin/sh is linked to /bin/dash which 
doesn't know the bash extensions.


Nils




More information about the ubuntu-users mailing list