next up previous contents index
Next: Korn Shell Command Up: Recalling Commands: history Previous: Recalling Commands: history

C Shell

Recalling a command to execute exactly as it did last time is fairly easy, but recalling a command to modify it is difficult and only a few of the many ways to recall pieces of commands or modify pieces of commands are mentioned here.

You can specify commands or parts of commands to reexecute by number, relative number, or by the text it contains:

For example, to reexecute the 4th command from the history list and to reexecute the last command starting with (ls):

 
               		  !4

!ls

The dollar sign ($) can be used to recall the last parameter of a command. For example, (!$) causes substitution of the last parameter of the last command. For example, to check if (myfile.f) is the correct file and then compile it:

 
              		  more myfile.f 

f77 !$

The following table shows several ways to substitute text in recalled commands. The first form allows you to substitute text in the previous command. In the second form (xx) stands for any of the ways described above to recall a command.



Alan Silverman
Wed Apr 12 16:54:02 METDST 1995