[BusyBox] [patch] ash problem with shell scripts (repost)

Glenn McGrath bug1 at optushome.com.au
Mon Sep 15 04:04:26 UTC 2003


On 13 Sep 2003 13:04:38 +0200
Jean Wolter <jw5 at os.inf.tu-dresden.de> wrote:

> Glenn McGrath <bug1 at optushome.com.au> writes:
> 
> > But, i get the same error with and without your patch.
> 
> Could you do an strace on busybox ash with the patch applied? It
> should show the following:
> 
> # strace -f -e execve ./busybox ash -c arg
> execve("./busybox", ["./busybox", "ash", "-c", "arg"], [/* 39 vars
> */]) = 0
> [pid  1660] execve("/home/jw5/bin/arg", ["arg"], [/* 39 vars */]) = -1
> ENOEXEC (Exec format error)
> [pid  1660] execve("/bin/sh", ["/bin/sh", "/home/jw5/bin/arg"], [/* 39
> vars */]) = 0

strace -f -e execve ash -c arg
execve("/bin/ash", ["ash", "-c", "arg"], [/* 50 vars */]) = 0
ash: arg: not found

strace -f -e execve /bin/busybox ash -c test.sh
execve("/bin/busybox", ["/bin/busybox", "ash", "-c", "test.sh"], [/* 50 vars */]) = 0
Process 23439 attached
Process 23438 suspended
[pid 23439] execve("/usr/bin/test.sh", ["test.sh"], [/* 50 vars */]) = -1 ENOEXEC (Exec format error)
[pid 23439] execve("/bin/sh", ["/bin/sh", "/usr/bin/test.sh"], [/* 50 vars */]) = 0
Process 23440 attached
[pid 23440] execve("/bin/echo", ["echo", "blah"], [/* 50 vars */]) = 0
blah
Process 23440 detached
[pid 23439] --- SIGCHLD (Child exited) @ 0 (0) ---
Process 23438 resumed
Process 23439 detached
--- SIGCHLD (Child exited) @ 0 (0) ---

# test.sh
blah
# sh /usr/bin/test.sh
blah
# sh test.sh
sh: Can't open test.sh





More information about the busybox mailing list