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.
3
votes
6answers
168 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
119 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 ...
0
votes
0answers
56 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. ...
1
vote
2answers
41 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
102 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
2answers
118 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
3answers
314 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
458 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
281 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 ...
3
votes
1answer
764 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
385 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
297 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
471 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
225 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 ...
5
votes
2answers
346 views
Can a home directory have both .cshrc and .bashrc files?
Or are they both not allowed at the same time?
0
votes
1answer
176 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?
1
vote
2answers
2k 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, ...
1
vote
3answers
745 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
855 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?