Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does !* mean in tcsh shell?

such as command

myCommand !* &

& is run in bg, but what is !* ? Can not find it anywhere, c shell is not used anywhere nowadays ...

like image 729
Shuman Avatar asked Oct 25 '25 15:10

Shuman


1 Answers

! is the start of a history substitution. !* means "all the arguments from the preceding command".

So if you first do:

echo foo bar baz

and then do

myCommand !* &

the second command is equivalent to:

myCommand foo bar baz &

If this is part of an alias definition, the "preceding" command is actually the invocation of the alias. So if you write

alias myc 'myCommand !* &'

Then writing

myc foo bar baz

is expanded into

myCommand foo bar baz &
like image 119
Barmar Avatar answered Oct 27 '25 05:10

Barmar