[opensuse] Re: umm BASH gurus, what does the typo $!/bin/bash do?
John Andersen wrote:
David C. Rankin wrote:
Can anybody tell me, or point me to any info, concerning just what $! did??
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.
Ahem, no. $! is a standard bash variable. From the bash manual: 3.4.2 Special Parameters ------------------------ The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed. [...] `!' Expands to the process ID of the most recently executed background (asynchronous) command. Since there has not been any background process in this subshell, it expands to the empty string. 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
participants (1)
-
Joachim Schrod