Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

what does "!*" do in shell script?

SOLVED
Go to solution
Henry Chua
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
Manish Srivastava
Trusted Contributor

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

Hi,

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

manish
Henry Chua
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!
Michael_356
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
Rodney Hills
Honored Contributor
Solution

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...
Henry Chua
Super Advisor

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

SOLVED .THANKS!!