Why if I chnod +x my script can I not do ./myscript ?

Jason Schoon floydpink at gmail.com
Fri Feb 24 17:10:52 UTC 2006


Here is a different/better question.  You have the full bash on your
system.  Why not link /bin/sh to that, rather than using busybox for your
shell?

On 2/24/06, Angus Comber <angus at iteloffice.com> wrote:
>
> I have tried
>
> #!/bin/bash
> #!/bin/bash
> #!/bin/ash
>
> script contents:
> #!/bin/sh
>
> # This script sends the asterisk call log to angus at mydomain.com
>
> cp email1backup email1
> cat /mnt/kd/cdr-csv/Master.csv >> email1
> cat email3 >> email1
> cat email1 | ssmtp angus at mydomain.com
>
> exit 0
>
>
> pbx Itel # cat /etc/shells
> /bin/bash
> /bin/ash
> /bin/sh
> pbx Itel #
>
>
> echo $SHELL
> /bin/sh
>
>
>
> pbx /bin # ls -l
> lrwxrwxrwx    1 root     root           19 Dec  8 06:09 addgroup ->
> ../usr/sbin/astwrap
> lrwxrwxrwx    1 root     root           19 Dec  8 06:09 adduser ->
> ../usr/sbin/astwrap
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ash -> busybox
> -rwxr-xr-x    1 root     root       475948 Feb 24  2005 bash
> -rwsr-xr-x    1 root     root       565388 Jun 29  2005 busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 cat -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 chgrp -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 chmod -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 chown -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 cp -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 cpio -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 date -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 dd -> busybox
> lrwxrwxrwx    1 root     root           19 Dec  8 06:09 delgroup ->
> ../usr/sbin/astwrap
> lrwxrwxrwx    1 root     root           19 Dec  8 06:09 deluser ->
> ../usr/sbin/astwrap
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 df -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 dmesg -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 echo -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 egrep -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 false -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 fgrep -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 grep -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 gunzip -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 gzip -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 hostname ->
> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ip -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ipaddr -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 iplink -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 iproute -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 iptunnel ->
> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 kill -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ln -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 login -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ls -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 mkdir -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 mknod -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 more -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 mount -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 mv -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 netstat -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 pidof -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ping -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 ps -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 pwd -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 rm -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 rmdir -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 sed -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 sh -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 sleep -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 stty -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 su -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 sync -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 tar -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 touch -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 true -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 umount -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 uname -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 uncompress ->
> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 usleep -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 vi -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 watch -> busybox
> lrwxrwxrwx    1 root     root            7 Dec  8 06:09 zcat -> busybox
> pbx /bin #
>
> filesystem is ext2
>
> file is called makeemail
>
> pbx Itel # ls makeemail -l
> -rwxrwxrwx    1 root     root          212 Feb 24 08:16 makeemail
> pbx Itel #
>
> I am logged in as root when running this.
>
>
> Hope this helps.
>
> Angus
>
>
>
>
> ----- Original Message -----
> *From:* Jason Schoon <floydpink at gmail.com>
> *To:* Paul Fox <pgf at brightstareng.com>
> *Cc:* busybox at mail.busybox.net
> *Sent:* Thursday, February 23, 2006 7:23 PM
> *Subject:* Re: Why if I chnod +x my script can I not do ./myscript ?
>
> Do you have #!/bin/bash at the top, rather than #!/bin/sh?
>
> As Paul noted, much more information would make this much easier to
> diagnose.  Contents of the file, type of shell(s) built into Busybox,
> default shell selected for Busybox, 'ls' of /bin, etc.
>
>
>
> On 2/23/06, Paul Fox <pgf at brightstareng.com> wrote:
> >
> > [ replying to the list.]
> >
> > > > > Hello
> > > > >
> > > > > I can run my script if I do
> > > > > /bin/sh myscript
> > > > >
> > > > > But not by
> > > > > ./myscript
> > > > >
> > > > > Even though I
> > > > > chmod +x myscript
> > > > >
> > > > > What am I missing?
> > > >
> > > > you're missing any information that can help us help you.
> > >
> > > *** Yes, sorry.
> > > >
> > > > what error message do you get?
> > > *** -sh: ./makeemail: not found
> >
> > odd this seems like a filesystem error.  what fs are you using?
> >
> > > >
> > > > what busybox shell are you using?
> >
> > or else it's a shell error.  are you using ash?
> >
> > paul
> >
> > > >
> > > > what version of busybox?
> > > *** BusyBox v1.00 (2005.06.29-07:42+0000) multi-call binary
> > > >
> >
> > =---------------------
> > paul fox, pgf at brightstareng.com
> > _______________________________________________
> > busybox mailing list
> > busybox at busybox.net
> > http://busybox.net/cgi-bin/mailman/listinfo/busybox
> >
>
>  ------------------------------
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060224/c88444db/attachment.htm 


More information about the busybox mailing list