Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

what does "!*" do in shell script?

SOLVED
Go to Solution
Super Advisor

what does "!*" do in shell script?

Recently I encounter a line in a shell program that I dun quite understand..
i.e. :
"'onintr -;T0 path $planpath \!*;T1 start \!* $t2;onintr "

T0, T1, and t2 all are assigned value in intial declaration..
what I am interested to know is what does these commands do and especially
what does the "!*" serve as.. ?
5 REPLIES
Trusted Contributor Trusted Contributor

Re: what does "!*" do in shell script?

Hi,

In bash it gives the arguments of the last executed command.

manish
Super Advisor

Re: what does "!*" do in shell script?

ic.. but how does it works?.. in this case.. or maybe an example to illustrate?...

thank you all for your advise!
Frequent Advisor Frequent Advisor

Re: what does "!*" do in shell script?

onintr : Controls the action of the shell on interrupts.
If - is specified, all interrupts are ignored.

The end of the line reset the interrupts-command

Regards

Michael
Highlighted
Honored Contributor Honored Contributor

Re: what does "!*" do in shell script?

onintr is a "csh" internal command and !* returns the last commands arguments into the command string (like bash).

The code you have turns off interupts, runs the program specified by T0 passing parameter "path $planpath" followed by the arguments from the command line that launched the script, then the program specified by T1 is run passing argument "start" followed by the command line arguments again, followed by "$t2".
The onintr at the end resets the "on interupt flag".

HTH

-- Rod Hills
There be dragons...
Super Advisor

Re: what does "!*" do in shell script?

SOLVED .THANKS!!