Posted: . At: 10:39 AM. This was 4 years ago. Post ID: 14412
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Very useful .cshrc file for a UNIX or Linux machine.


This is a very useful .cshrc file for any Linux or UNIX machine. This gives a very nice prompt and a few very useful aliases.

/etc/csh.login
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# /etc/csh.login: This file contains login defaults used by csh and tcsh.
# $Thanks 2> http://www.grymoire.com/Unix/Csh.html
# Set up some environment variables:
source ~/.complete
if ($?prompt) then
        umask 022
        set cdpath = ( /var/spool )
        set notify
        set history = 1000
        set savehist = 500
        setenv MINICOM "-c on"
        setenv HOSTNAME "`uname -n`"
        setenv LESS "-M"
        setenv LESSOPEN "|lesspipe.sh %s"
        setenv DOOMWADDIR "/usr/share/games/doom"
        set path = ( $path /usr/X11R6/bin /usr/games $HOME/bin /usr/local/games )
endif
 
# If the user doesn't have a .inputrc, use the one in /etc.
if (! -r "$HOME/.inputrc") then
        setenv INPUTRC /etc/inputrc
endif
 
# I had problems with the backspace key installed by 'tset', but you might want
# to try it anyway, instead to the 'setenv term.....' below it.
# eval `tset -sQ "$term"`
 setenv term linux
# if ! $?TERM setenv TERM linux
# Set to "linux" for unknown term type:
if ("$TERM" == "") setenv TERM linux
if ("$TERM" == "unknown") setenv TERM linux
 
# Set default POSIX locale:
setenv LC_ALL POSIX
setenv traditional_complete
alias cls 'clear'
alias ls 'ls -hula --color=auto'
alias tarunpack 'tar -xvf'
alias bz2unpack 'tar -jxvf'
 
# Set the default shell prompt:
 
set prompt = "\[%n@$HOSTNAME\]:%~%# "
 
# Set up the LS_COLORS environment variable for color ls output:
eval `dircolors -c`
 
# Notify user of incoming mail.  This can be overridden in the user's
# local startup file (~/.login)
#biff y
 
# Append any additional csh scripts found in /etc/profile.d/:
[ -d /etc/profile.d ]
if ($status == 0) then
        set nonomatch
        foreach file ( /etc/profile.d/*.csh )
                [ -x $file ]
                if ($status == 0) then
                        source $file
                endif
        end
        unset file nonomatch
endif

Get detailed information about your terminal this way.

[jason@Yog-Sothoth]:~% telltc

Use the set noclobber option in the shell, this will prevent accidental overwriting of files.

[jason@Yog-Sothoth]:~% echo "foo" > vimeo.sh
vimeo.sh: File exists.

But the files can still be deleted with rm -f.

And this method can still force a write to the file.

echo "hi" >! testing.txt

I cannot write to a file this way.

[jason@Yog-Sothoth]:~% echo "hi" > me
me: File exists.

But if I use an exclamation mark after the redirection operator, it forces the write.

[jason@Yog-Sothoth]:~% echo "hi" >! me
[jason@Yog-Sothoth]:~% cat me
hi

So that is how it can be overridden.

There is much more information about the UNIX C shell here: https://www.mkssoftware.com/docs/man1/csh.1.asp.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.