The Tcsh package contains “an enhanced but completely compatible version of the Berkeley Unix C shell (csh)”. This is useful as an alternative shell for those who prefer C syntax to that of the bash shell, and also because some programs require the C shell in order to perform installation tasks.
This package is known to build and work properly using an LFS-7.10 platform.
Download (HTTP): http://fossies.org/linux/misc/tcsh-6.19.00.tar.gz
Download (FTP): ftp://ftp.astron.com/pub/tcsh/tcsh-6.19.00.tar.gz
Download MD5 sum: f5f854833578647795bc906dd4bcb5d5
Download size: 928 KB
Estimated disk space required: 15 MB (with tests)
Estimated build time: 0.2 SBU (with tests)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/tcsh
First, fix the package for tool chain changes:
sed -e 's/ i)/ k)/' \ -e '/ k)/ i \ k = i;' \ -e '/\*cp/ a \ volatile size_t k;' \ -i tc.alloc.c && sed -i 's|SVID_SOURCE|DEFAULT_SOURCE|g' config/linux && sed -i 's|BSD_SOURCE|DEFAULT_SOURCE|g' config/linux && sed -i 's|^ union wait|int|' sh.proc.c
Install Tcsh by running the following commands:
sed -i 's|fR/g|&m|' tcsh.man2html && ./configure --prefix=/usr --bindir=/bin && make && sh ./tcsh.man2html
To test the results, issue: make check.
Now, as the root
user:
make install install.man && ln -v -sf tcsh /bin/csh && ln -v -sf tcsh.1 /usr/share/man/man1/csh.1 && install -v -m755 -d /usr/share/doc/tcsh-6.19.00/html && install -v -m644 tcsh.html/* /usr/share/doc/tcsh-6.19.00/html && install -v -m644 FAQ /usr/share/doc/tcsh-6.19.00
sed -i 's|fR/g|&m|' tcsh.man2html: This updates some deprecated Perl code.
--bindir=/bin
: This
installs the tcsh
program in /bin
instead of
/usr/bin
.
sh ./tcsh.man2html: This creates HTML documentation from the formatted man page.
ln -v -sf tcsh
/bin/csh: The FHS states that if there is a
C shell installed, there should be
a symlink from /bin/csh
to it. This
creates that symlink.
There are numerous configuration files for the C shell. Examples
of these are /etc/csh.cshrc
,
/etc/csh.login
, /etc/csh.logout
, ~/.tcshrc
, ~/.cshrc
, ~/.history
, ~/.cshdirs
, ~/.login
, and ~/.logout
. More information on these files can
be found in the tcsh(1)
man page.
Update /etc/shells
to include the C
shell program names (as the root
user):
cat >> /etc/shells << "EOF"
/bin/tcsh
/bin/csh
EOF
The following ~/.cshrc
provides two
alternative colour prompts and coloured ls output. If you prefer a
global modification, issue the command as the root
user, replacing ~/.cshrc
by /etc/csh.cshrc
.
cat > ~/.cshrc << "EOF"
# Original at:
# https://www.cs.umd.edu/~srhuang/teaching/code_snippets/prompt_color.tcsh.html
# Modified by the BLFS Development Team.
# Add these lines to your ~/.cshrc (or to /etc/csh.cshrc).
# Colors!
set red="%{\033[1;31m%}"
set green="%{\033[0;32m%}"
set yellow="%{\033[1;33m%}"
set blue="%{\033[1;34m%}"
set magenta="%{\033[1;35m%}"
set cyan="%{\033[1;36m%}"
set white="%{\033[0;37m%}"
set end="%{\033[0m%}" # This is needed at the end...
# Setting the actual prompt. Two separate versions for you to try, pick
# whichever one you like better, and change the colors as you want.
# Just don't mess with the ${end} guy in either line... Comment out or
# delete the prompt you don't use.
set prompt="${green}%n${blue}@%m ${white}%~ ${green}%%${end} "
set prompt="[${green}%n${blue}@%m ${white}%~ ]${end} "
# This was not in the original URL above
# Provides coloured ls
alias ls ls --color=always
# Clean up after ourselves...
unset red green yellow blue magenta cyan yellow white end
EOF
Last updated on 2016-08-31 20:11:41 -0700