David C. Rankin wrote:
On Friday 02 October 2009 03:26:05 am Brian K. White wrote:
So, you'd think the script exited, but no you were still in the script, still busy executing the first line, /bin/bash, until you typed exit or hit ctrl-d, (/bin/bash finishes), at that point the rest of the script would run.
Yah, but you out to have seen all the output when I typed
strace ./scriptname
Then the $!/bin/bash was not in the first line: puma:tmp $ strace ./try.sh execve("./try.sh", ["./try.sh"], [/* 145 vars */]) = -1 ENOEXEC (Exec format error) dup(2) = 3 fcntl64(3, F_GETFL) = 0x8002 (flags O_RDWR|O_LARGEFILE) fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 8), ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f6d000 _llseek(3, 0, 0xbff8b20c, SEEK_CUR) = -1 ESPIPE (Illegal seek) write(3, "strace: exec: Exec format error\n", 32strace: exec: Exec format error) = 32 close(3) = 0 munmap(0xb7f6d000, 4096) = 0 exit_group(1) = ? As I wrote, such a file only works when called by bash directly, not via exec(), which is used by strace. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org