Tcsh is which shell
There are also non-login shells, such as those that execute commands implemented as csh scripts, or those that execute! Non-login shells read only. Consequently, if a command must be run for each shell that starts up, the command should usually appear in.
Commands that need to be run only at login should appear in. Examples of the latter include:. Commands that affect your terminal settings, like tset, reset , and stty. Commands that set environment variables.
Non-login shells inherit environment variables from the login shell, so you need to set those variables only once, using. Commands like biff , which controls the announcement of new mail, or mesg , which determines whether other users can write to your terminal.
Commands that produce output. For instance, some people like to execute uptime at login time to find out how busy the system is, msgs —q to see if there are new system messages, who to see who else is logged in, or date to display the current date and time. A shell can be interactive or non-interactive.
An interactive shell interacts with a user, who types commands. A non-interactive shell receives input from another source, such as a script file. Interactive and non-interactive shells have somewhat different capabilities and behaviors.
For example, only interactive shells print a prompt or allow you to use job control and command history. Commands that apply only to interactive shells can be skipped, reducing start up time:. The if -statement tests whether the prompt variable has a value, to distinguish between interactive and non-interactive shells.
Commands that are relevant only to interactive shells can be placed between the if and the endif , and non-interactive shells will ignore them. If you include a set prompt command in your. If you put a lot of stuff in your startup files, they can get pretty long. One way to reduce clutter is to group similar commands into separate files, and then reference them using the source command.
For example, you might put your aliases and command editor key bindings in the files. You could then refer to the files in. Another advantage to this approach is that if you change one of the individual files, you can source it without having to reprocess your entire. Even if tcsh is your login shell, csh may read your. Some programs are implemented as csh scripts, so. Therefore, you need to be careful about putting tcsh -specific commands in your.
An error will occur if csh tries to execute tcsh commands like bindkey or complete. You can avoid problems by using the following construct to protect tcsh -specific commands from csh. Csh typically prints out a numbered list of the last commands you've typed.
To run any of the commands again type! NN where NN is the history number of the previous command. You can also type! If you type! Don't make the number too high or csh will run out of memory.
It is also possible to do history substitution, running a command from the history list with a few changes to it. For more details on this see the History Substitutions section of the csh manual page man csh. Let's say you're sending e-mail to someone telling them about the ls command and you want to include a portion of the man page, such as what the -l switch does.
Tells the shell to believe that the terminal capability cap as defined in termcap has the value value. No sanity checking is done.
Concept terminal users may have to " settc xn no " to get proper wrapping at the rightmost column. Controls which tty modes see Terminal management the shell does not allow to change. The available modes, and thus the display, vary from system to system.
With -a , lists all tty modes in the chosen set whether or not they are fixed. Set the experimental version prefix to string , or removes it if string is omitted. Without arguments, discards argv[1] and shifts the members of argv to the left. It is an error for argv not to be set or have less than one word as value.
With variable, performs the same function on variable. The shell reads and executes commands from name. The commands are not placed on the history list. If any args are given, they are placed in argv. An error in a source at any level terminates all nested source commands. With -h , commands are placed on the history list instead of being executed, much like " history -L ".
Stops the specified jobs or processes that are executing in the background. There is no default job; saying only " stop " does not stop the current job. This is most often used to stop shells started by su. Each case label is successively matched, against the specified string that is first command- and filename-expanded. If none of the labels match before a "default" label is found, then the execution begins after the default label.
Each case label and the default label must appear at the beginning of a line. The command breaksw causes execution to continue after the endsw. Otherwise control may fall through case labels and default labels as in C. If no label matches and there is no default, execution continues after the endsw. Tests if terminal type or the current value of TERM if no terminal type is given has an entry in the hosts termcap or terminfo database.
Prints the terminal type to stdout and returns 0 if an entry is present otherwise returns 1. Executes command which must be a simple command, not an alias, a pipeline, a command list or a parenthesized command list and prints a time summary as described under the time variable.
If necessary, an extra shell is created to print the time statistic when the command completes. Without command , prints a time summary for the current shell and its children. Sets the file creation mask to value , which is given in octal. Common values for the mask are , giving all access to the group and read and execute access to others, and , giving read and execute access to the group and others.
Without value, prints the current file creation mask. Removes all aliases whose names match pattern. It is not an error for nothing to be unaliased.
Removes all completions whose names match pattern. It is not an error for nothing to be uncompleted. Removes the limitation on resource or, if no resource is specified, all resource limitations. With -h , the corresponding hard limits are removed. Only the super-user may do this. Note that unlimit may not exit successful since most systems do not allow descriptors to be unlimited.
With -f errors are ignored. Removes all variables whose names match pattern , unless they are read-only. It is not an error for nothing to be unset. Removes all environment variables whose names match pattern. It is not an error for nothing to be unsetenv ed. With systype and command , executes command under systype. The shell waits for all background jobs. If the shell is interactive, an interrupt will disrupt the wait and cause the shell to print the names and job numbers of all outstanding jobs.
An alternate name for the log builtin command. Reports all known instances of command , including aliases, builtins and executables in path. Displays the command that will be executed by the shell after substitutions, path searching, etc.
The builtin command is like which , but it correctly reports tcsh aliases and builtins and is 10 to times faster. See also the which-command editor command. Executes the commands between the while and the matching end while expr an expression, as described under Expressions evaluates non-zero. If the input is a terminal, the user is prompted the first time through the loop as with foreach.
Runs after every change of working directory. Note that putting a cd , pushd or popd in cwdcmd may cause an infinite loop. Anyone doing so gets what they deserve. Runs before each command gets executed, or when the command changes state. This is similar to postcmd , but it does not print builtins. Invoked by the run-help editor command. The command name for which help is sought is passed as sole argument. Currently there is no easy way to account for various calling conventions e.
Runs every tperiod minutes. This provides a convenient means for checking on common but infrequent changes such as new mail. If periodic is set but tperiod is unset or set to 0 , periodic behaves like precmd.
Runs before each prompt is printed. For example, if one does alias precmd date then date runs before the shell prompts for each command. There are no limits on what precmd can be set to do, but discretion should be used. Runs before each command gets executed. Specifies the interpreter for executable scripts which do not themselves specify an interpreter.
The first word should be a full path name to the desired interpreter e. Set by default. If set, autologout 's autolock feature uses its value instead of the local username for kerberos authentication. The arguments to the shell. Positional parameters are taken from argv , i.
Set by default, but usually empty in interactive shells. If set, the expand-history editor command is invoked automatically before each completion attempt. If this is set to onlyhistory , then only history will be expanded and a second completion expands filenames. If set, possibilities are listed after an ambiguous completion. If set to " ambiguous ", possibilities are listed only when no new characters are added by completion.
The first word is the number of minutes of inactivity before automatic logout. The optional second word is the number of minutes of inactivity before automatic locking.
When the shell automatically logs out, it prints "auto-logout", sets the variable logout to " automatic " and exits. When the shell automatically locks, the user is required to enter his password to continue working. Five incorrect attempts result in automatic logout. Set to " 60 " automatic logout after 60 minutes, and no locking by default in login and superuser shells, but not if the shell thinks it is running under a window system i.
See also the afsuser and logout shell variables. If set, the internal hash table of the contents of the directories in the path variable will be recomputed if a command is not found in the hash table. Also, the list of available commands will be rebuilt for each command completion or spelling correction attempt if set to " complete " or " correct " respectively; if set to " always ", this will be done for both cases.
The file name of the message catalog. If set, tcsh use " tcsh. A list of directories where cd should search for subdirectories if they aren't found in the current directory. Alternatively, it can be set to only ls-F or only ls to enable color to only one command.
Setting it to nothing is equivalent to setting it to ls-F ls. If set, it enables color escape sequence for NLS message files. And display colorful NLS messages. If set to " igncase ", the completion becomes case insensitive. If set to " enhance ", completion ignores case and considers hyphens and underscores to be equivalent; it also treats periods, hyphens and underscores ". If set to " Enhance ", completion matches uppercase and underscore characters explicitly and matches lowercase and hyphens in a case-insensivite manner; it treats periods, hyphens and underscores as word separators.
If set to a list of commands, the shell continues the listed commands, instead of starting a new one. If set to " cmd ", commands are automatically spelling-corrected. If set to " complete ", commands are automatically completed. If set to " all ", the entire command line is corrected. If set, newlines and carriage returns in command substitution are replaced by spaces. The full pathname of the current directory. See also the dirstack and owd shell variables. The default location where " dirs -S " and " dirs -L " look for a history file.
An array of all the directories on the directory stack. One can change the stack arbitrarily by setting dirstack , but the first element the current working directory is always correct. See also the cwd and owd shell variables. Has an effect if " dspm " is listed as part of the version shell variable. If set to " euc ", it enables display and editing EUC-kanji Japanese code.
If set to " big5 ", it enables display and editing Big5 Chinese code. If set to " utf8 ", it enables display and editing Utf8 Unicode code. Each character is set to number 0 , 1 , 2 and 3. Each number has the following meaning: If set, pushd removes any instances of name from the stack before pushing it onto the stack. If set, each command with its arguments is echoed before it is executed.
For non-builtin commands all expansions occur before echoing. Builtin commands are echoed before command and filename substitution, because these substitutions are then done selectively. Set by the -x command line option. The style of the echo builtin. May be set to bsd. In tcsh , completion is always used and this variable is ignored by default.
If edit is unset, then the traditional csh completion is used. If set in csh , filename completion is used. If set, wildcard glob patterns will match files and directories beginning with ". If set, the incremental search match in i-search-back and i-search-fwd and the region between the mark and the cursor are highlighted in reverse video.
Highlighting requires more frequent terminal writes, which introduces extra overhead. If you care about terminal performance, you may want to leave this unset.
A string value determining the characters used in History substitution. The first character of its value is used as the history substitution character, replacing the default character "! Controls handling of duplicate entries in the history list.
If set to " all " only unique history events are entered in the history list. If set to " prev " and the last history event is the same as the current command, then the current command is not entered in the history. If set to " erase " and the same event is found in the history list, that old event gets erased and the current one gets inserted. Note that the " prev " and " all " options renumber history events so there are no gaps.
The default location where " history -S " and " history -L " look for a history file. If set, builtin and editor commands and the savehist mechanism use the literal unexpanded form of lines in the history list.
See also the toggle-literal-history editor command. The first word indicates the number of history events to save. Set to " " by default. Initialized to the home directory of the invoker. This prevents the shell from accidentally being killed. Historically this setting exited after 26 successive EOF 's to avoid infinite loops. If set to a number n , the shell ignores n - 1 consecutive end-of-files and exits on the n th.
If unset, " 1 " is used, i. If set, the shell treats a directory name typed as a command as though it were a request to change to that directory. If set to verbose , the change of directory is echoed to the standard output. This behavior is inhibited in non-interactive shell scripts, or for command strings with more than one word.
Changing directory takes precedence over executing a like-named command, but it is done after alias substitutions. Tilde and variable expansions work as expected. If set to " insert " or " overwrite ", puts the editor into that input mode at the beginning of each line. Controls handling of duplicate entries in the kill ring. If set to " all " only unique strings are entered in the kill ring. If set to " prev " and the last killed string is the same as the current killed string, then the current string is not entered in the ring.
If set to " erase " and the same string is found in the kill ring, the old string is erased and the current one is inserted. Indicates the number of killed strings to keep in memory.
Set to " 30 " by default. If unset or set to less than " 2 ", the shell only keeps the most recently killed string. Strings are put in the killring by the editor commands that delete kill strings of text, e. The yank editor command will yank the most recently killed string into the command-line, while yank-pop see Editor commands can yank earlier killed strings. If set to " x ", " a " or " A ", or any combination thereof e.
If the second word of listflags is set, it is used as the path to " ls ". If set, all jobs are listed when a job is suspended. If set to "long", the listing is in long format. The maximum number of items which the list-choices editor command lists without asking first. The maximum number of rows of items which the list-choices editor command lists without asking first. Set by the shell if it's a login shell. Setting or unsetting it within a shell has no effect. See also shlvl. Set by the shell to " normal " before a normal logout, " automatic " before an automatic logout, and " hangup " if the shell was killed by a hangup signal see Signal Handling.
See also the autologout shell variable. A list of files and directories to check for incoming mail, optionally preceded by a numeric word. Before each prompt, if 10 minutes have passed since the last check, the shell checks each file and says "You have new mail. If you are in a login shell, then no mail file is reported unless it was modified after the time the shell has started up, to prevent redundant notifications.
Most login programs will tell you whether or not you have mail when you log in. If a file specified in mail is a directory, the shell will count each file within that directory as a separate message, and will report "You have n mails.
This functionality is provided primarily for those systems which store mail in this manner, such as the Andrew Mail System. If the first word of mail is numeric it is taken as a different mail checking interval, in seconds. If set to " never ", completion never beeps. If set to " nomatch ", it beeps only when there is no match. If set to " ambiguous ", it beeps when there are multiple matches. If set to " notunique ", it beeps when there is one exact and other longer matches.
If unset, " ambiguous " is used. If set, disable the printing of " DING! This is most useful in shell scripts which do not deal with filenames, or after a list of filenames is obtained and further expansions are not desirable. If set and the shell supports Kanji see the version shell variable , it is disabled so that the meta key can be used.
If set, a Filename Substitution and Directory Stack Substitution which does not match any existing files is left untouched rather than causing an error. It is still an error for the substitution to be malformed, e. A list of directories or glob-patterns which match directories; see Filename Substitution that should not be stat ed during a completion operation.
If set, the shell announces job completions asynchronously. The default is to present job completions before printing a prompt. The old working directory, equivalent to the " - " used by cd and pushd.
See also the cwd and dirstack shell variables. If set, enable the printing of padding " 0 " for hours, in 24 and 12 hour formats. To retain compatibility with older versions numeric variables starting with 0 are not interpreted as octal. Setting this variable enables proper octal parsing.
A list of directories where to look for executable commands. A null word specifies the current directory. If there is no path variable then only full path names will execute.
The shell may put ". If one adds a new command to a directory in path while the shell is active, one may need to do a rehash for the shell to find it. The string that is printed before reading each command from the terminal. The trailing component of the current working directory, or n trailing components if a digit n is given.
If the ellipsis shell variable is set, skipped components are represented by an ellipsis so the whole becomes " Includes string as a literal escape sequence. It should be used only to change terminal attributes and should not move the cursor location. This cannot be the last sequence in prompt. In prompt2 , the status of the parser. In prompt3 , the corrected string.
In history , the history string. The string with which to prompt when confirming automatic spelling correction. The string to print on the right side of the screen after the command input when the prompt is being displayed on the left.
It recognizes the same formatting characters as prompt. It automatically disappears and reappear as necessary, to ensure that command input isn't obscured, and appears only if the prompt, command input, and itself will fit together on the first line. If edit isn't set, then rprompt will be printed after the prompt and before the command input. If set, the shell does " dirs -S " before exiting. If the first word is set to a number, at most that many directory stack entries are saved.
If set, the shell does " history -S " before exiting. If the first word is set to a number, at most that many lines are saved. The number must be less than or equal to history. If the second word is set to " merge ", the history list is merged with the existing history file instead of replacing it if there is one and sorted by timestamp and the most recent events are retained.
The file where the shell resides. This is used in forking shells to interpret files which have execute bits set, but that are not executable by the system. Initialized to the system-dependent home of the shell.
Asked 11 years, 2 months ago. Active 7 years, 5 months ago. Viewed 92k times. Improve this question. I don't think I've ever heard of someone switching to bash; normally people use bash because it's the default and then switch to something better : — Michael Mrozek.
Michael: Well, OS X switched from tcsh to bash in version I find it somewhat amusing that everyone is suggesting zsh. At the same time it's not amusing because it doesn't really answer the ops question. Straight up though, unless you are having problems learning how to shell script tcsh, go with what you know.
If you have problems using tcsh post your problem on here. Don't switch just 'cause. There are more bash posts because it's installed by default in more places, that doesn't make it better. Show 4 more comments. Active Oldest Votes. Improve this answer. Add a comment. I'm not sure what is guaranteed. Another point:!
0コメント