Command Line History Substitution

This section provides a quick introduction of C shell command line history substitution.

C Shell Command Line History Substitution: Brings in parts of previously executed commands. History substitution uses the following designators and modifiers:

1. Event Designator - Identifies a previously executed command line:

2. History Modifier - Modifies the command line identified by the event designator:

Examples of C shell command line history substitution:

>csh
%who
herong     tty1     Jul 21 21:36
tom        tty2     Jul 21 18:15
%/bin/echo C Shell command line history substitution
C Shell command line history substitution
%touch new file
%ls -l new file
-rw-r--r--   1 herong   users           0 Jul 21 21:56 new file
%history
     1  21:54    who
     2  21:55    /bin/echo C Shell command line history substitution
     3  21:56    touch new file
     4  21:56    ls -l new file
     5  21:58    history
%!!
     1  21:54    who
     2  21:55    /bin/echo C Shell command line history substitution
     3  21:56    touch new file
     4  21:56    ls -l new file
     5  21:58    history
     6  21:59    history
%echo !2:$
echo substitution
substitution
%echo !2:h
echo /bin C Shell command line history substitution
/bin C Shell command line history substitution
%!ls
ls -l new file
-rw-r--r--   1 herong   users           0 Jul 21 21:56 new file

Table of Contents

 About This Book

 1957 - FORTRAN Language Developed by IBM

 1970 - UNIX Operating System Developed by AT&T Bell Labs

 1971 - FTP Protocol Created by Abhay Bhushan

 1972 - C Language Developed by Dennis Ritchie

 1976 - vi Text Editor Developed by Bill Joy

 1977 - Apple II Designed by Steve Jobs and Steve Wozniak

 1977 - The Bourne Shell Developed by Stephen Bourne

1978 - The C Shell Developed by Bill Joy

 What Is the C Shell?

 C Shell Command Line

Command Line History Substitution

 Command Line Alias Substitution

 Command Line Input and Output Redirection

 Command Line Variable Substitution

 C Shell Command Line Examples

 ".cshrc" - C Shell Script File and

 1978 - Bash (Bourne-Again Shell) Developed by Brian Fox

 1979 - The Tcsh (TENEX C Shell) Developed by Ken Greer

 1983 - "Sendmail" Mail Transfer Agent Developed by Eric Allman

 1984 - Macintosh Developed by Apple Inc.

 1984 - X Window System Developed a MIT Team

 1991 - WWW (World Wide Web) Developed by Tim Berners-Lee

 1991 - Gopher Protocol Created by a University of Minnesota Team

 1995 - Java Language Developed by Sun Microsystems

 1995 - PHP: Hypertext Preprocessor Created by Rasmus Lerdorf

 2002 - .NET Framework Developed by Microsoft

 References

 PDF Printing Version