The C shell (csh), once one of the two major Unix shells with the Bourne shell. Csh had more advanced interactive feature but has been surpassed by modern Bourne-style shells such as zsh and bash.

learn more… | top users | synonyms

1
vote
0answers
49 views

alias Not able to execute source command

I am trying to define a following alias in my .aliases file. alias sett 'cleartool setview viewXYZ_!*; cd /path_dir1/dir2/; source ./env/script-name' I use it as sett myview on commnd prompt when I ...
1
vote
3answers
707 views

dircolors “missing second token”

I'd like to customize the colors of ls and as far as I understand the way to go is with dircolors. I did: dircolors > ~/.dircolors Immediately after this I launch a terminal and get this error: ...
2
votes
1answer
77 views

How to enable double tab autocompletion list in bash?

I've worked in Linux before where when I press tab it autocompletes until it becomes ambiguous. If I pressed tab twice at that point it would give me a list of all possible completions. My current ...
1
vote
1answer
32 views

csh: Is there a prompt outside of $prompt?

Consider this c-shell grab: [<my-user>@<my-host> ~]>echo $SHELL /bin/csh \033]30;<my-host-name>\007\c [<my-user>@<my-host> ~]>set | grep prompt prompt [%n@%m ...
4
votes
3answers
3k views

stderr redirection not working in csh

I run the following command: pkg_add emacs-23.4,2.tbz 2> output.log The output still displays in the terminal. When I press ↑, I get pkg_add emacs-23.4,2.tbz 2 > output.log with a space ...
1
vote
2answers
161 views

Will a '*' (star) in globbing match only characters (i.e , a-z and 0-9)?

I havie a simple question here: does a * (star wildcard) match only characters (letters and numbers) in glob style? Or will it also match special characters? In bash, * matches everything, while in ...
2
votes
1answer
84 views

syntax error: unexpected end of file

#!/bin/csh -f set no=1460 while ("$no">0) if [$no>900]; then set m=3 else if ["$no">450 && "$no"<901]; then set m=2 else set m=1 fi mv *$no.bin test/abc-$m-$no.bin set no ...
6
votes
2answers
8k views

Difference between 2>&-, 2>/dev/null, |&, &>/dev/null and >/dev/null 2>&1

Just looking for the difference between 2>&- 2>/dev/null |& &>/dev/null >/dev/null 2>&1 and their portability with non-Bourne shells like tcsh, mksh, etc.
1
vote
2answers
78 views

Create file with specific formatting from directory contents

I am using Solaris and csh. In $home/test there are five files: a.txt, b.txt, c.txt, d.txt and e.txt. If I run % find $home/test/ -type f -print > ../filenames.txt that file will look like: ...
2
votes
1answer
406 views

C Shell script condition for if string contains a newline character

I'm not sure how to express this using the csh string matching syntax. I want to test whether a csh variable contains a newline. I'm basically looking for: if ($mystr !~ <pattern for strings which ...
1
vote
1answer
46 views

What causes a csh script to sometimes not source /etc/csh.cshrc?

I have a csh post-installation script that is executed from an rpm %post with its interpreter line set to #!/bin/csh (without the -f option). This should cause the file /etc/csh.cshrc to be read ...
1
vote
1answer
75 views

Illegal float value “error” c-shell

I have a form made it with a couple of text boxes, in which I input floating numbers and use this number to sum with other text box and put the result in a label. I then input the values of the text ...
2
votes
3answers
133 views

How do I make pasted shell commands invisible?

I'm using an AutoHotkey macro to run some shell commands, i.e. ^`:: SendInput set c=".cshrc-acheong"{ENTER} SendInput set v=".vimrc-acheong"{ENTER} SendInput foreach d ( /home/acheong /home/tcama ...
0
votes
1answer
36 views

Script in C shell skipping over last else statement?

This is a C shell script that checks the number of arguments and if the file/directory exists. When the arguments are valid, it should go to the last else statement and print "hi", but when I run this ...
2
votes
1answer
75 views

Which is the real PATH variable

On my office computer it seems like I've have two PATH variables. $path : This is delimited by " " (Space) $PATH : This is delimited by ":" (Colon) Though when I update one, the other one ...
1
vote
1answer
357 views

Changing text color in c-shell

I can change the text color in the terminal permanently by adding this: export PS1="\e[0;31m[\u@\h \W]\$ \e[m" to the .bashrc file. Now I have to go into cshell, what is the corresponding way?
0
votes
3answers
89 views

I want to print a line when a user login [duplicate]

I what to print "you are on an important server" whenever a user(any user) login to a server. Is the way is to edit each user .cshrc file?
7
votes
2answers
803 views

Is it possible to redefine the tilde ('~', home directory)?

Is it possible to redefine the home directory? e.g. to /ext1/acheong instead of /home/acheong, i.e. expanding the ~ to another directory (as opposed to changing the actual home directory where users' ...
1
vote
2answers
460 views

“~/” receives a permission denied error in Csh

Running in Csh when using Tilde Notation performing a ~/ at the command line, I receive a "Permission denied." error. This directory is owned by the user performing the command and has the ...
1
vote
4answers
156 views

How do I run a program in a fresh shell?

I have a program that does a LOT of env manipulation. It sets PYTHONPATH and LD_LIBRARY_PATH and stuff like that. This program needs to run ANOTHER program, but in a fresh env, without all of the ...
1
vote
0answers
32 views

Properly defining a multi-line prompt in tcsh

I am trying to configure my prompt in tcsh to make it multi-line (i.e having one line provide system info, and the next line the one where I type commands). Currently I have the following: set ...
1
vote
1answer
324 views

FreeBSD csh, TAB to show available choices?

I am a newbie to FreeBSD. How can i configure csh or tcsh to show available choices by pressing TAB twice, just like bash?
1
vote
1answer
46 views

Grep expression with special file names

I have to go through some regular files in directories and find those files, that have their own name in its content. In the following piece of script is a cycle in which I am going through paths ...
1
vote
2answers
141 views

Use of find in unix on strange file/directory names

Im a beginner scripter, writing scripts in tcsh and csh (these are taught in my course). I'm writing a script which uses find for putting path of directories this is the part of the script: set list ...
1
vote
1answer
1k views

C shell script : how do I compare two strings?

I'm a C shell user. I've two files. file 1: A B C D E file 2: A C B D E I want to compare only A-A, B-C, C-B, D-D, E-E using a for loop. If the strings match, then print "match". The output ...
2
votes
2answers
249 views

setting variables inside subshell when using <<

I am using the following method in order to pass commands into a subshell that is started by "newgrp". #!/bin/csh echo "Before newgrp" /usr/bin/newgrp users <<EONG echo "hello from within ...
1
vote
2answers
222 views

Which programme calls csh.cshrc?

I understand that when a user logs into unix remotely, first a getty process is started. If authentication is successful, then etc/environement is called. However, I do not understand when is ...
1
vote
1answer
183 views

How do I start smbclient from a script in Linux?

I want to be able to quickly start smbclient to a specific directory without typing or copying it to the shell command line, but just sticking it in a script doesn't seem to work... #!/bin/csh ...
1
vote
1answer
122 views

How can I clear portion of what is typed into the prompt while working on Linux and using C-shell?

I am working in Linux and C-shell. Often times I would require to change some portion of what is there already in the prompt that I obtain from reverse searching through the history command by use of ...
1
vote
2answers
47 views

Can I see in history output from which directory I had actually issued a command?

CTRL+R allows me to reverse search through the command history which is great but can I also find out from which directory that command was run? I am using C-shell in Linux.
1
vote
2answers
122 views

enf of file unexpected (excepting “f$ing ”fi")

os: pfSense (nanobsd) shell: csh script: /etc/rc.conf_mount_rw mount -t msdosfs /dev/da0s1 /mnt/usb if ( -s /var/squid/log/access.log ) then cat /var/squid/log/access.log | perl -p -e ...
3
votes
3answers
527 views

Preventing duplicate entried in PATH (.cshrc)

I have little experience with Linux, so I will appreciate some help. I need to prepend directories to the path variable in my .cshrc file and I want to make sure that the entries are not repeated when ...
1
vote
0answers
179 views

less does not show expected output after sourcing a script in .cshrc

In our university we have a script to setup the working environment under linux. Since I am lazy I decided to add this process to the shell initialization by adding source /setup/script to .cshrc. ...
3
votes
6answers
328 views

How do I specify arguments to return all dot files, but not . and ..?

Normally dot files are not included for wildcard expansion: % echo * Applications Desktop Documents Downloads Library Movies Music Pictures Public bin If I explicitly ask for dot files, I get them: ...
1
vote
2answers
166 views

Can't remove same folder name twice

I have a folder called - bin , then I remove it by rm bin , re-create it and when I want to remove it again by rm bin the shell promts - /bin/mv: cannot move `bin/' to ...
1
vote
2answers
80 views

Why would running a directory path as a command return “permission denied” and not “command not found”? [duplicate]

I am an a redhat box and I noticed that if I accidentally type in a dir path without cd in front of it, I get a /path/to/dir/: Permission denied.; however, I would expect it to say /path/to/dir/: ...
1
vote
1answer
396 views

Error converting a bash function to a csh alias

I am writing a csh alias so that I can use the following bash function in my csh : function up( ) { LIMIT=$1 P=$PWD for ((i=1; i <= LIMIT; i++)) do P=$P/.. done cd ...
1
vote
3answers
901 views

How to change shells via script?

I have to repeat following operation a lot of times, hence I want to automate it. sudo su tcsh cd $workDir Here $workDir is set in ~/.tcshrc. I tried writing two shells scripts. Script1 is temp.sh ...
2
votes
1answer
3k views

How to debug csh scripts?

My lab uses csh scripts to run jobs. It is usually difficult for me to debug a shell script, so I'm wondering if there is a csh debugger I can use. I know there are some flags like -x or -v that can ...
2
votes
1answer
774 views

Inserting a file into another file using sed

I want to insert the contents of file1 into file2 after a matching PATTERN. I want to do it only after the first occurrence of the PATTERN. I would like to know the modification I need to make to ...
2
votes
1answer
543 views

What's wrong with this csh file?

I don't have any experience writing .sh files. I want to run the pvm2raw utility of this app from the Volume Library. I get the following error when running build.sh in Ubuntu 10.10. build.sh is ...
1
vote
2answers
1k views

Alias Loop in csh

Why is there an Alias loop error created here: alias df 'printf "\n"; df -hP | column -t' But not here: alias df 'df -hP | column -t' I realize I could call the alias something else and still ...
1
vote
1answer
317 views

colorizing ls output based on filename

i'm on freeBSD and trying to colorize ls output, so i've added alias ls ls -lhG setenv LSCOLORS gxfxcxdxbxegedabagacad to my .cshrc and it works. but what i really want to - is to be able ...
0
votes
1answer
288 views

debug php script and output result and errors to a text file

Can someone tell me how to to run a php script and output content and errors to a text file (using nohup) using csh?
5
votes
2answers
550 views

Can a home directory have both .cshrc and .bashrc files?

Or are they both not allowed at the same time?
1
vote
2answers
4k views

sed command to replace a blank line with two lines of content

How do I replace the first blank line with two lines of content? I did see a question on replacing multiple blank lines with a single blank line in vim sed but don't quite see how to adapt that. So, ...
2
votes
3answers
1k views

cshrc execute bashrc within itself?

My school has our Linux accounts using csh/tcsh by default. I, however, have a lot setup on my home bashrc and I'd like to use that at school. BUT there's also some important stuff that happens in our ...
3
votes
5answers
1k views

Does $SHELL store the path to the default shell in Linux?

My administrator says that my default shell is set to bash, but $ echo $SHELL /bin/csh $ Is the default shell related to the SHELL variable at all? Is not, what is the variable used for?