Skip to main content

Questions tagged [csh]

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.

256 votes
3 answers
229k 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.
Det's user avatar
  • 2,682
46 votes
2 answers
23k views

Are there problems with hyphens in functions, aliases, and executables?

In my testing (in Bash and Z Shell), I saw no problems with defining functions or aliases or executable shell scripts which have hyphens in the name, but I'm not confident that this will be okay in ...
iconoclast's user avatar
  • 9,258
26 votes
3 answers
3k views

How does a shell know home(s)?

Each shell has an environment variable $HOME set (ex: /Users/lotolo). If I'm under csh I can unsetenv HOME and still if I do cd I'll be in my home. I've tested this also on bash (unset HOME) and it'...
LotoLo's user avatar
  • 616
16 votes
3 answers
15k views

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

Is it possible to redefine the home directory? e.g. to /ext1/username instead of /home/username, i.e. expanding the ~ to another directory (as opposed to changing the actual home directory where users'...
Andrew Cheong's user avatar
15 votes
4 answers
40k 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 ...
gadgetmo's user avatar
  • 821
15 votes
2 answers
18k views

Is it possible to send a HEREDOC over ssh to a remote host from inside a script running locally?

I essentially want to run a script on machine A which will SSH into machine B, execute commands on B, and return the output to machine A. So I am creating a csh script to do this, hopefully, if it's ...
krb686's user avatar
  • 559
11 votes
4 answers
25k views

Convert value from scientific notation to decimal in shell?

How to convert value from scientific notation to decimal in shell? (preferred C shell) Also I'd want to convert it from e-12 to e-9 and then shell 42.53e-12 to 0.04253. I have to do this for a list.
cHiRaG's user avatar
  • 133
8 votes
6 answers
4k 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: ...
user11498's user avatar
  • 2,451
7 votes
2 answers
30k 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 ...
Cassie's user avatar
  • 221
7 votes
3 answers
501 views

'switch' based on shell

I would like to source (i.e. not call) a script from any shell (bash/csh are the primary targets, but fish, zsh, ksh, and rc would also be interesting). I would like if the script can be a single ...
Ole Tange's user avatar
  • 35.8k
6 votes
2 answers
7k views

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

Or are they both not allowed at the same time?
InquilineKea's user avatar
  • 6,322
6 votes
6 answers
4k 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: ...
Mark Adler's user avatar
  • 2,005
6 votes
1 answer
733 views

What's special about "!xxx%s%s%s%s%s%s%s%s"?

I was linked to The Unix-Haters Handbook and stumbled on (page 149): Subject: Relevant Unix bug October 11, 1991 Fellow W4115x students— While we’re on the subject of activation ...
Alexey Romanov's user avatar
6 votes
1 answer
12k views

Is there a csh to bash script translator?

Programming in C shell is considered harmful by some people, but csh scripts are continued to be written by some hardcore csh fans. Is there a free/open source converter to translate csh script into ...
Gowtham's user avatar
  • 2,089
6 votes
2 answers
10k views

How to enable double tab autocompletion list in csh?

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 ...
greggmi's user avatar
  • 163

15 30 50 per page
1
2 3 4 5
20