Hello,
> Why do a lot of bash scripts start with the first line as #!/bin/bash
It means that the script must be executed by the program #!/bin/bash.
> They seem to work just as well without.
Not if you were using another shell than bash, like csh or tcsh, which uses
different syntax. Try the following :
bash# cat > tmpscript
#
export TOTO='hello world'
echo $TOTO
bash# chmod +x ./tmpscript
bash# tmpscript
hello world
bash# csh
csh% tmpscript
export: Command not found.
TOTO: Undefined variable.
- curious about bash scripts Kuruvilla Chandy
- Re: curious about bash scripts Kurt Wall
- Re: curious about bash scripts Wes Leonard
- Re: curious about bash scripts Kurt Wall
- RE: curious about bash scripts Cort
- Re: curious about bash scripts Etienne Grossmann
- Re: curious about bash scripts Etienne Grossmann
- RE: curious about bash scripts LENGARD Pascal OCISI
