[opensuse] Re: umm BASH gurus, what does the typo $!/bin/bash do?
- From: Joachim Schrod <jschrod@xxxxxxx>
- Date: Fri, 02 Oct 2009 10:38:43 +0200
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@xxxxxxx
Roedermark, Germany
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
- References:
- [opensuse] umm BASH gurus, what does the typo $!/bin/bash do?
- From: David C. Rankin
- [opensuse] umm BASH gurus, what does the typo $!/bin/bash do?
- Prev by Date: Re: [opensuse] Can use the incoming mailserver but not the outgoing mailserver.
- Next by Date: [opensuse] Re: Deleting /dev/md1 -- will other MDs get renumbered?
- Previous by thread: Re: [opensuse] Re: umm BASH gurus, what does the typo $!/bin/bash do?
- Next by thread: [opensuse] Booting w/o RAM disk w/Grub...
- Index(es):
Relevant Pages
|