fbpx
Wikipedia

tcsh

tcsh (/ˌtˈsʃɛl/ “tee-see-shell”, /ˈtʃɛl/ “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell based on and backward compatible with the C shell (csh).

TENEX C Shell
Screenshot of a sample tcsh session
Developer(s)Ken Greer, Paul Placeway, Christos Zoulas, et al.
Stable release
6.24.07[1]  / 21 December 2022; 40 days ago (21 December 2022)
Repository
  • github.com/tcsh-org/tcsh
Written inC
Operating systemCross-platform
TypeUnix shell
License2002: BSD-3-Clause[2][3]
1991: BSD-4-Clause[4]
Websitewww.tcsh.org

Shell

It is essentially the C shell with programmable command-line completion, command-line editing, and a few other features. Unlike the other common shells, functions cannot be defined in a tcsh script and the user must use aliases instead (as in csh). It is the native root shell for BSD-based systems such as FreeBSD.

tcsh added filename and command completion and command line editing concepts borrowed from the TENEX operating system, which is the source of the “t”.[5] Because it only added functionality and did not change what was there, tcsh remained backward compatible[6] with the original C shell. Though it started as a side branch from the original csh source tree that Bill Joy had created, tcsh is now the main branch for ongoing development.

tcsh is very stable but new releases continue to appear roughly once a year, consisting mostly of minor bug fixes.[7]

On many systems, such as macOS and Red Hat Linux, csh is actually tcsh. Often one of the two files is either a hard link or a symbolic link to the other, so that either name refers to the same improved version of the C shell.

On Debian and some derivatives (including Ubuntu), there are two different packages: csh and tcsh. The former is based on the original BSD version of csh[8][9] and the latter is the improved tcsh.[10][11]

History

The “t” in tcsh comes from the “T” in TENEX, an operating system which inspired Ken Greer at Carnegie Mellon University, the author of tcsh, with its command-completion feature.[12] Greer began working on his code to implement Tenex-style file name completion in September 1975, finally merging it into the C shell in December 1981.[5] Mike Ellis at Fairchild A.I. Labs added command completion in September 1983.[5] On October 3, 1983, Greer posted source to the net.sources newsgroup.[5]

Significant features

  • Command history
    • The built-in history command displays the previously entered commands
    • Use of / at the command line to allow the user to select a command from the history to edit/execute
    • Invoking previous commands using command history
      • !! executes the previous command
      • !n executes the nth command that was previously executed
      • !-n executes the command that was executed n commands ago
      • !string executes the most recently executed command that starts with string
      • !?string executes the most recently executed command that contains string
    • Using history in new commands
      • !* - refers to all of the arguments from the previous command
      • !$ - refers to the last argument from the previous command
      • !^ - refers to the first argument from the previous command
      • !:n - refers to the nth argument from the previous command
      • !:m-n - refers to the mth through nth arguments from the previous command
      • !:n-$ - refers to the nth 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.
    • \!# - argument selector for all arguments, including the alias/command itself; arguments need not be supplied.
    • \!* - argument selector for all arguments, excluding the alias/command; arguments need not be supplied.
    • \!$ - 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.
    • \!^ - argument selector for first argument; argument MUST be supplied.
    • \!:n - argument selector for the nth argument; argument MUST be supplied; n=0 refers to the alias/command name.
    • \!:m-n - argument selector for the arguments from the mth to the nth; arguments MUST be supplied.
    • \!:n-$ - argument selector for the arguments from the nth to the last; at least argument n MUST be supplied.
    • \!:n* - argument selector for the arguments from the nth to the last; sufficient arguments need not be supplied.
      #Alias the cd command so that when you change directories, the contents are immediately displayed. alias cd 'cd \!* && ls' 
  • Wildcard matching
    if ( "$input" =~ [0-9]* ) then  echo "the input starts with an integer" else  echo "the input does NOT start with an integer" endif 
  • Job control
  • The built-in where command. Works like the which command but shows all locations of the target command in the directories specified in $PATH rather than only the one that will be used.

Deployment

Early versions of Mac OS X shipped with tcsh as the default shell, but the default for new accounts became bash as of 10.3 then zsh as of 10.15. (tcsh is still provided, and upgrading the OS does not change the shell of any existing accounts). tcsh is the default root shell of FreeBSD (the default user shell is POSIX-based)[13][14] and its descendants like DragonFly BSD and DesktopBSD.

See also

References

  1. ^ "Release 6.24.07". 21 December 2022. Retrieved 26 December 2022.
  2. ^ "remove clause 3 of the copyright". 2002-03-08.
  3. ^ "Remove clause 3 of the copyright (changed in other files 2002-03-08)". 2014-07-14.
  4. ^ "Tcsh-6.00 release". 1991-07-04.
  5. ^ a b c d Ken Greer (3 Oct 1983). "C shell with command and filename recognition/completion". Newsgroup: net.sources. Retrieved 29 December 2010.
  6. ^ . tcsh.
  7. ^ Fixes file in tcsh-17 June 2000.
  8. ^ Ubuntu - Details of package csh. Packages.ubuntu.com.
  9. ^ Debian - Details of package csh. Packages.debian.org.
  10. ^ Ubuntu - Details of package tcsh. Packages.ubuntu.com.
  11. ^ Debian - Details of package tcsh. Packages.debian.org.
  12. ^ . Archived from the original on 14 April 2012. Retrieved 31 October 2013.
  13. ^ Michael Urban; Brian Tiemann (2002). Sams teach yourself FreeBSD in 24 hours. Sams Publishing. p. 56. ISBN 978-0-672-32424-6.
  14. ^ POSIX 2008 Shell Command Language "The System V shell was selected as the starting point for the Shell and Utilities volume of POSIX.1-2008. The BSD C shell was excluded from consideration"

External links

  • Official website
  • tcsh releases
  • tcsh mailing list
  • Archive for the O'Reilly book "Using csh and tcsh"

tcsh, this, article, relies, excessively, references, primary, sources, please, improve, this, article, adding, secondary, tertiary, sources, find, sources, tcsh, news, newspapers, books, scholar, jstor, 2020, learn, when, remove, this, template, message, shel. This article relies excessively on references to primary sources Please improve this article by adding secondary or tertiary sources Find sources Tcsh news newspapers books scholar JSTOR May 2020 Learn how and when to remove this template message tcsh ˌ t iː ˈ s iː ʃ ɛ l tee see shell ˈ t iː ʃ ɛ l tee shell or as tee see ess aitch tcsh is a Unix shell based on and backward compatible with the C shell csh TENEX C ShellScreenshot of a sample tcsh sessionDeveloper s Ken Greer Paul Placeway Christos Zoulas et al Stable release6 24 07 1 21 December 2022 40 days ago 21 December 2022 Repositorygithub wbr com wbr tcsh org wbr tcshWritten inCOperating systemCross platformTypeUnix shellLicense2002 BSD 3 Clause 2 3 1991 BSD 4 Clause 4 Websitewww wbr tcsh wbr org Contents 1 Shell 2 History 3 Significant features 4 Deployment 5 See also 6 References 7 External linksShell EditIt is essentially the C shell with programmable command line completion command line editing and a few other features Unlike the other common shells functions cannot be defined in a tcsh script and the user must use aliases instead as in csh It is the native root shell for BSD based systems such as FreeBSD tcsh added filename and command completion and command line editing concepts borrowed from the TENEX operating system which is the source of the t 5 Because it only added functionality and did not change what was there tcsh remained backward compatible 6 with the original C shell Though it started as a side branch from the original csh source tree that Bill Joy had created tcsh is now the main branch for ongoing development tcsh is very stable but new releases continue to appear roughly once a year consisting mostly of minor bug fixes 7 On many systems such as macOS and Red Hat Linux csh is actually tcsh Often one of the two files is either a hard link or a symbolic link to the other so that either name refers to the same improved version of the C shell On Debian and some derivatives including Ubuntu there are two different packages csh and tcsh The former is based on the original BSD version of csh 8 9 and the latter is the improved tcsh 10 11 History EditThe t in tcsh comes from the T in TENEX an operating system which inspired Ken Greer at Carnegie Mellon University the author of tcsh with its command completion feature 12 Greer began working on his code to implement Tenex style file name completion in September 1975 finally merging it into the C shell in December 1981 5 Mike Ellis at Fairchild A I Labs added command completion in September 1983 5 On October 3 1983 Greer posted source to the net sources newsgroup 5 Significant features EditCommand history The built in history command displays the previously entered commands Use of at the command line to allow the user to select a command from the history to edit execute Invoking previous commands using command history executes the previous command n executes the nth command that was previously executed n executes the command that was executed n commands ago i string i executes the most recently executed command that starts with string i string i executes the most recently executed command that contains string Using history in new commands refers to all of the arguments from the previous command refers to the last argument from the previous command refers to the first argument from the previous command n refers to the nth argument from the previous command m n refers to the mth through nth arguments from the previous command n refers to the nth 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 argument selector for all arguments including the alias command itself arguments need not be supplied argument selector for all arguments excluding the alias command arguments need not be supplied 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 argument selector for first argument argument MUST be supplied n argument selector for the nth argument argument MUST be supplied n 0 refers to the alias command name m n argument selector for the arguments from the mth to the nth arguments MUST be supplied n argument selector for the arguments from the nth to the last at least argument n MUST be supplied n argument selector for the arguments from the nth to the last sufficient arguments need not be supplied Alias the cd command so that when you change directories the contents are immediately displayed alias cd cd amp amp ls Wildcard matchingif input 0 9 then echo the input starts with an integer else echo the input does NOT start with an integer endif Job control The built in where command Works like the which command but shows all locations of the target command in the directories specified in PATH rather than only the one that will be used Deployment EditEarly versions of Mac OS X shipped with tcsh as the default shell but the default for new accounts became bash as of 10 3 then zsh as of 10 15 tcsh is still provided and upgrading the OS does not change the shell of any existing accounts tcsh is the default root shell of FreeBSD the default user shell is POSIX based 13 14 and its descendants like DragonFly BSD and DesktopBSD See also Edit Free and open source software portalComparison of command shellsReferences Edit Release 6 24 07 21 December 2022 Retrieved 26 December 2022 remove clause 3 of the copyright 2002 03 08 Remove clause 3 of the copyright changed in other files 2002 03 08 2014 07 14 Tcsh 6 00 release 1991 07 04 a b c d Ken Greer 3 Oct 1983 C shell with command and filename recognition completion Newsgroup net sources Retrieved 29 December 2010 tcsh 1 man page tcsh Fixes file in tcsh 17 June 2000 Ubuntu Details of package csh Packages ubuntu com Debian Details of package csh Packages debian org Ubuntu Details of package tcsh Packages ubuntu com Debian Details of package tcsh Packages debian org The T in tcsh Archived from the original on 14 April 2012 Retrieved 31 October 2013 Michael Urban Brian Tiemann 2002 Sams teach yourself FreeBSD in 24 hours Sams Publishing p 56 ISBN 978 0 672 32424 6 POSIX 2008 Shell Command Language The System V shell was selected as the starting point for the Shell and Utilities volume of POSIX 1 2008 The BSD C shell was excluded from consideration External links EditOfficial website tcsh releases tcsh mailing list tcsh manual page Archive for the O Reilly book Using csh and tcsh Retrieved from https en wikipedia org w index php title Tcsh amp oldid 1119564366, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.