Difference between revisions of "TcShell"
Thalhammer (talk | contribs) (Fixed link) |
|||
(10 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | [[Category:Tools]] | |
− | The interface between the unix system and the user is called (unix-)'''shell'''. There are in principle many types of shells available. They differ in built-in commands and scripting syntax (e.g. | + | The interface between the unix system and the user is called (unix-)'''shell'''. There are in principle many types of shells available. They differ in built-in commands and scripting syntax (e.g. |
+ | <code>for-loops</code>). However, the commands for basic file operations (<code>cd, cp, rm, ...</code>) are in principle identical and running other programs is done by executing the binary file via <code>./binaryfile</code>. If the binary is located in one of the directories specified in the <code>PATH</code> variable, the program can be executed from every where in the file system without the leading ./ | ||
Nearly all unix distributions (Ubuntu, SuSe, ...) are using a different default shell. The default shell on the Remeis computers is the '''TC-shell''', which is based on the C-shell. If you want to know on which shell you are operating right now, type | Nearly all unix distributions (Ubuntu, SuSe, ...) are using a different default shell. The default shell on the Remeis computers is the '''TC-shell''', which is based on the C-shell. If you want to know on which shell you are operating right now, type | ||
echo $SHELL | echo $SHELL | ||
− | in, which should result in | + | in, which should result in <code>/bin/tcsh</code>. |
− | + | = Configuration = | |
− | Each user can change the default behavior of the TC-shell via the configuration file ~/.cshrc | + | Each user can change the default behavior of the TC-shell via the configuration file ~/.cshrc <br /> |
This file gets executed each time a new TC-shell is started. Thus changes are applied only after a new shell is opened! The default configuration file looks like | This file gets executed each time a new TC-shell is started. Thus changes are applied only after a new shell is opened! The default configuration file looks like | ||
Line 35: | Line 36: | ||
The first line tells the system on which shell the script should be executed. This can be set by | The first line tells the system on which shell the script should be executed. This can be set by | ||
#!path_to_shell_binary some_options | #!path_to_shell_binary some_options | ||
− | Of course, the shell here is the TC-shell, located in | + | Of course, the shell here is the TC-shell, located in <code>/bin/tcsh</code>. |
− | + | = Prompt = | |
− | The following block defines some specific variables: | + | The following block defines some specific variables: <code>prompt</code> defines how your prompt (the information on the left of the command line) should look like. The available place holders are defined as follows: |
− | | %\ | current directory | | + | {| class="wikitable" |
− | | %~ | current directory with user's home as ~ | | + | | %\ || current directory |
− | | %n | username | | + | |- |
− | | %m | hostname | | + | | %~ || current directory with user's home as ~ |
+ | |- | ||
+ | | %n || username | ||
+ | |- | ||
+ | | %m || hostname | ||
+ | |} | ||
For the default value this results, e.g, in | For the default value this results, e.g, in | ||
username@remeiscomputer:~> | username@remeiscomputer:~> | ||
Line 49: | Line 55: | ||
"`whoami`@`hostname -s`:`pwd`> " | "`whoami`@`hostname -s`:`pwd`> " | ||
− | + | = Default Editor = | |
The (commented) line | The (commented) line | ||
# setenv EDITOR jed | # setenv EDITOR jed | ||
− | defines the default editor which is executed if the command | + | defines the default editor which is executed if the command <code>$EDITOR</code> is entered. This is important for editors of [[GIT -- The Fast Version Control System|git-repositories]], because <code>git commit</code> calls the in $EDITOR defined command such that the user can enter a comment describing the changes. If this variable is not set or commented, the default editor would be <code>joe</code> or <code>vim</code>. They are very fast editors, but not user-friendly. To uncommment the line just remove the # at the beginning of the line. |
Latest revision as of 12:58, 21 June 2018
The interface between the unix system and the user is called (unix-)shell. There are in principle many types of shells available. They differ in built-in commands and scripting syntax (e.g.
for-loops
). However, the commands for basic file operations (cd, cp, rm, ...
) are in principle identical and running other programs is done by executing the binary file via ./binaryfile
. If the binary is located in one of the directories specified in the PATH
variable, the program can be executed from every where in the file system without the leading ./
Nearly all unix distributions (Ubuntu, SuSe, ...) are using a different default shell. The default shell on the Remeis computers is the TC-shell, which is based on the C-shell. If you want to know on which shell you are operating right now, type
echo $SHELL
in, which should result in /bin/tcsh
.
Configuration
Each user can change the default behavior of the TC-shell via the configuration file ~/.cshrc
This file gets executed each time a new TC-shell is started. Thus changes are applied only after a new shell is opened! The default configuration file looks like
#!/bin/tcsh -f set prompt="%n@%m:%~> " set nobeep = 1 set matchbeep = never alias l 'ls -l --color=auto' alias ls 'ls --color=auto' # setenv EDITOR jed if(-d $HOME/bin) setenv PATH $HOME/bin:$PATH # LaTeX # setenv TEXINPUTS .:~/share/latex:: # setenv BIBINPUTS .:~/share/bibtex:: # setenv BSTINPUTS .:~/share/bibtex/bibstyles:: # Astro software source /data/system/software/softwarescript.csh source $SOFTDIR/softwarescript_Xray.csh
The first line tells the system on which shell the script should be executed. This can be set by
#!path_to_shell_binary some_options
Of course, the shell here is the TC-shell, located in /bin/tcsh
.
Prompt
The following block defines some specific variables: prompt
defines how your prompt (the information on the left of the command line) should look like. The available place holders are defined as follows:
%\ | current directory |
%~ | current directory with user's home as ~ |
%n | username |
%m | hostname |
For the default value this results, e.g, in
username@remeiscomputer:~>
You can also add the output of other commands to the prompt using `command` in the definition. The value "%n@%m:%\> " is equal to
"`whoami`@`hostname -s`:`pwd`> "
Default Editor
The (commented) line
# setenv EDITOR jed
defines the default editor which is executed if the command $EDITOR
is entered. This is important for editors of git-repositories, because git commit
calls the in $EDITOR defined command such that the user can enter a comment describing the changes. If this variable is not set or commented, the default editor would be joe
or vim
. They are very fast editors, but not user-friendly. To uncommment the line just remove the # at the beginning of the line.