Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Tcsh
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Significant features== *Command history **The built-in <code>history</code> command displays the previously entered commands **Use of {{Keypress|UP}} / {{Keypress|DOWN}} at the command line to allow the user to select a command from the history to edit/execute **Invoking previous commands using [[command history]] ***<code>!!</code> executes the previous command ***<code>!n</code> executes the nth command that was previously executed ***<code>!-n</code> executes the command that was executed ''n'' commands ago ***<code>!''string''</code> executes the most recently executed command that starts with ''string'' ***<code>!?''string''</code> executes the most recently executed command that contains ''string'' **Using history in new commands ***<code>!*</code> - refers to all of the arguments from the previous command ***<code>!$</code> - refers to the last argument from the previous command ***<code>!^</code> - refers to the first argument from the previous command ***<code>!:n</code> - refers to the n<sup>th</sup> argument from the previous command ***<code>!:m-n</code> - refers to the m<sup>th</sup> through n<sup>th</sup> arguments from the previous command ***<code>!:n-$</code> - refers to the n<sup>th</sup> through the last argument from the previous command *Command line editing *Auto-completion of file names and variables as well as programmable completion at the command line *Alias argument selectors; the ability to define an alias to take arguments supplied to it and apply them to the commands that it refers to. Tcsh is the only shell that provides this feature (in lieu of functions). **<code>\!#</code> - argument selector for all arguments, including the alias/command itself; arguments need not be supplied. **<code>\!*</code> - argument selector for all arguments, excluding the alias/command; arguments need not be supplied. **<code>\!$</code> - argument selector for the last argument; argument need not be supplied, but if none is supplied, the alias name is considered to be the last argument. **<code>\!^</code> - argument selector for first argument; argument MUST be supplied. **<code>\!:n</code> - argument selector for the n<sup>th</sup> argument; argument MUST be supplied; n=0 refers to the alias/command name. **<code>\!:m-n</code> - argument selector for the arguments from the m<sup>th</sup> to the n<sup>th</sup>; arguments MUST be supplied. **<code>\!:n-$</code> - argument selector for the arguments from the n<sup>th</sup> to the last; at least argument n MUST be supplied. **<code>\!:n*</code> - argument selector for the arguments from the n<sup>th</sup> to the last; sufficient arguments need not be supplied.<syntaxhighlight lang="csh"> #Alias the cd command so that when you change directories, the contents are immediately displayed. alias cd 'cd \!* && ls' </syntaxhighlight> *Wildcard matching<syntaxhighlight lang="csh"> if ( "$input" =~ [0-9]* ) then echo "the input starts with an integer" else echo "the input does NOT start with an integer" endif </syntaxhighlight> *Job control *The built-in <code>where</code> command. Works like the <code>which</code> command but shows '''all''' locations of the target command in the directories specified in <code>$PATH</code> rather than only the one that will be used.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)