David C. Rankin wrote:
Guys,
This was bizarre. Doing a quick script, I accidentally did a $!/bin/bash instead of #!/bin/bash. The script gave no output, but appeared to be struggling much longer than it should (~1 sec) then would exit normally. No error no nothing. Something worked though. I had set a trap to remove a temp dir in it and provide output. When I ssh'ed into another box and came back, evidently the EXIT signal was generated and the trap ran -- even though it the script defined $! instead of #!.
Can anybody tell me, or point me to any info, concerning just what $! did??
Larry Wall 'splains it all... http://tldp.org/LDP/abs/html/sha-bang.html (lower part) You don't actually need the #! in a bash script if bash is your default shell. So it was probably trying to figure out what $ meant. Then it saw the !. When you type a word preceeded by an "!", bash thinks you want to recall a previous command or "event". It happens in interactive shells, when the C-Shell-styled history expansion (”!searchword”) is enabled. This is the default. Then it probably recovered and just continued. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org