Re: scripts won't execute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> 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@iolon240 cgi-bin]# pwd
> /var/www/cgi-bin
> 
> # This is what the two files contain--
> [root@iolon240 cgi-bin]# cat ./test.sh
> #!/bin/sh
> echo "asdf"
> 
> # Here I run the two files and see a difference
> [root@iolon240 cgi-bin]# ./test2.sh
> asdf
> [root@iolon240 cgi-bin]# ./test.sh
> [root@iolon240 cgi-bin]#
> 
> # Here is a listing of them to show identical modes
> [root@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@iolon240 cgi-bin]# diff test*
> 
> --
> fedora-list mailing list
> fedora-list@xxxxxxxxxx
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux