scripts won't execute

Jamie Bohr jamiebohr at gmail.com
Wed Nov 17 20:11:57 UTC 2004


I have seen this type problem in the past, there was always hidden
character in the bad file.  vi on Linux will hide them where as vi on
HP-UX will not.  By chance was one of them created on a Windows
system?  Try running dos2unix on the bad file to see if it addresses
the problem.  If that does not work what does "sh -x ./test.sh" show?

- Jamie Bohr


On Wed, 17 Nov 2004 11:50:17 -0800, Andrew B. Young
<andrew_b_young at earthlink.net> wrote:
> I'm stumped.  I have two separate script files that are *identical*,
> but one executes as expected, the other does nothing.  The only
> difference between the two is how they were created.  The one that
> does execute was created in /root and then moved to /var/www/cgi-bin.
> The one that does not execute was created directly in
> /var/www/cgi-bin.  Why should this cause a difference?  Here are some
> details.
> 
> -andyy
> 
> # Here is where I am--
> [root at iolon240 cgi-bin]# pwd
> /var/www/cgi-bin
> 
> # This is what the two files contain--
> [root at iolon240 cgi-bin]# cat ./test.sh
> #!/bin/sh
> echo "asdf"
> 
> # Here I run the two files and see a difference
> [root at iolon240 cgi-bin]# ./test2.sh
> asdf
> [root at iolon240 cgi-bin]# ./test.sh
> [root at iolon240 cgi-bin]#
> 
> # Here is a listing of them to show identical modes
> [root at iolon240 cgi-bin]# ll test*
> -rwxr-xr-x  1 root root 23 Nov 17 11:28 test2.sh
> -rwxr-xr-x  1 root root 23 Nov 17 11:22 test.sh
> 
> # I diff'ed the files and get nothing
> [root at iolon240 cgi-bin]# diff test*
> 
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
>




More information about the users mailing list