Operating System - HP-UX
1752569 Members
5132 Online
108788 Solutions
New Discussion юеВ

Re: 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 5
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
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!!