At 12:01 PM 9/9/2005, bob self wrote:
I have a simple test script called 'scripttest' in /root/bin:
-rwxr-xr-x 1 root wheel 121 Sep 9 14:55 scripttest
my $PATH IS
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:*/root/bin*
#!/bin/sh
echo
Glenn Dawson wrote:
Assuming you're using csh, did you rehash after creating the script?
Did you try to execute it with it's full path? like:
/root/bin/scripttest
-Glenn
Yes, I did 'rehash'. I'm running tcsh as root, FreeBSD 6.0.
Also, I ran /root/bin/scripttest and I still get command not
On 9/9/2005 11:01, bob self seems to have typed:
If I run which scripttest, I get /root/bin/scripttest
But if I try to run this test script I get scripttest: Command not found.
Its a stupid thought, but could you run which sh?
___
At 12:49 PM 9/9/2005, bob self wrote:
Glenn Dawson wrote:
Assuming you're using csh, did you rehash after creating the script?
Did you try to execute it with it's full path? like:
/root/bin/scripttest
-Glenn
Yes, I did 'rehash'. I'm running tcsh as root, FreeBSD 6.0.
Also, I ran
Peter A. Giessel wrote:
On 9/9/2005 11:01, bob self seems to have typed:
If I run which scripttest, I get /root/bin/scripttest
But if I try to run this test script I get scripttest: Command not found.
Its a stupid thought, but could you run which sh?
[EMAIL PROTECTED]/bin#
Peter A. Giessel wrote:
On 9/9/2005 11:01, bob self seems to have typed:
If I run which scripttest, I get /root/bin/scripttest
But if I try to run this test script I get scripttest: Command not found.
Its a stupid thought, but could you run which sh?
* bob self [EMAIL PROTECTED] [2005-09-09 15:01:25 -0400]:
#!/bin/sh
echo pinging
#end of scripttest
If I run which scripttest, I get /root/bin/scripttest
But if I try to run this test script I get scripttest: Command not found.
Why is that happening?
I've seen something like this
N.J. Thomas wrote:
I've seen something like this happen when there is a non-printing
character on the shebang line (like a CTRL-G or similar). So instead of
running /bin/sh, your shell tries to run /bin/sh^G -- which obviously
doesn't exist.
Can you run xxd /root/bin/scripttest and show us the
bob self [EMAIL PROTECTED] writes:
xxd scripttest:
000: 2321 2f62 696e 2f73 680d 0a65 6368 6f20 #!/bin/sh..echo
^^-- BAD NEWS
It doesn't work on 5.4, either, or probably any Unixy OS.
BTW, the base OS comes with hd for a similar display.
* bob self [EMAIL PROTECTED] [2005-09-09 18:41:35 -0400]:
000: 2321 2f62 696e 2f73 680d 0a65 6368 6f20 #!/bin/sh..echo
^^
010: 2270 696e 6769 6e67 2e2e 2e2e 220d 0apinging..
Yup, that's your problem. This file is a DOS text file, so its end
I wasn't aware of the eol issue and don't know how the 0x0d got there,
but I fixed it with 'dosunix' and it works now.
Thanks,
Bob
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To
N.J. Thomas [EMAIL PROTECTED] writes:
Normally, that doesn't matter because most Unix utilities are
multi-eol-format aware, but you can't have it in the shebang line
because the OS interprets the extra carriage as part of the command, so
it is looking for /bin/sh^M, which doesn't exist.
Know
12 matches
Mail list logo