[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
#!/bin/sh versus #!/bin/bash
- From: Matthew Zimmerman <mzimmerman virginia edu>
- To: fedora-list redhat com
- Subject: #!/bin/sh versus #!/bin/bash
- Date: Fri, 9 Jan 2004 17:57:08 -0500
I can't seem to get bash scripts to run by themselves
if I put /bin/bash in the poundbang line of my Bash shell
scripts . If I use /bin/sh (I run Bash interactively),
things work normally:
---
matt macko ~ $ vim test.sh
matt macko ~ $ chmod +x test.sh
matt macko ~ $ cat test.sh
#!/bin/sh
echo Hello world
matt macko ~ $ ./test.sh
Hello world
matt macko ~ $ . ./test.sh
Hello world
---
However, if I modify the poundbang line to call /bin/bash
instead...
---
matt macko ~ $ vim test.sh
matt macko ~ $ chmod +x test.sh
matt macko ~ $ cat test.sh
#!/bin/bash
echo Hello world
matt macko ~ $ ./test.sh
./test.sh: ./test.sh: No such file or directory
matt macko ~ $ . ./test.sh
Hello world
---
But both binaries are there:
---
matt macko ~ $ ls -l /bin/{,ba}sh
-rwxr-xr-x 1 root root 599860 Oct 28 09:15 /bin/bash*
lrwxrwxrwx 1 root root 4 Dec 12 16:11 /bin/sh -> bash*
---
Any ideas what the heck is going on? I've noticed this on RH8
and RH9 as well.
--
Matt
Matthew Zimmerman
Interdisciplinary Biophysics, University of Virginia
http://www.people.virginia.edu/~mdz4c/
----------------------------------------------------
Lab: 4-223 Jordan Hall, 1300 Jefferson Park Avenue,
Charlottesville, VA 22908 (434)924-2948
Home: 2655-C Barracks Road
Charlottesville, VA 22901 (434)244-7989
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]