Questions tagged [tcsh]

tcsh is an enhanced but completely compatible version of the Berkeley UNIX C shell, csh.

Quoted from the manpage:

tcsh is an enhanced but completely compatible version of the Berkeley UNIX C shell csh It is a command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax.

tcsh is the default shell on FreeBSD & DragonFly BSD, and was the default shell on earlier versions on Mac OS X.

Since tcsh is completely compatible with , almost all versions of csh encountered are actually tcsh.

Official site: http://www.tcsh.org/

704 questions
796
votes
29 answers

How to determine the current interactive shell that I'm in (command-line)

How can I determine the current shell I am working on? Would the output of the ps command alone be sufficient? How can this be done in different flavors of Unix?
josh
  • 13,793
  • 12
  • 49
  • 58
558
votes
20 answers

Can a shell script set environment variables of the calling shell?

I'm trying to write a shell script that, when run, will set some environment variables that will stay set in the caller's shell. setenv FOO foo in csh/tcsh, or export FOO=foo in sh/bash only set it during the script's execution. I already know…
Larry Gritz
  • 13,331
  • 5
  • 42
  • 42
370
votes
3 answers

Changing default shell in Linux

How is it possible to change the default shell? The env command currently says: SHELL=/bin/tcsh and I want to change that to Bash.
mahmood
  • 23,197
  • 49
  • 147
  • 242
252
votes
13 answers

How to generate a core dump in Linux on a segmentation fault?

I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
112
votes
7 answers

Check if a file is executable

I am wondering what's the easiest way to check if a program is executable with bash, without executing it ? It should at least check whether the file has execute rights, and is of the same architecture (for example, not a windows executable or…
bob
  • 1,993
  • 3
  • 17
  • 20
92
votes
14 answers

Generate a random filename in unix shell

I would like to generate a random filename in unix shell (say tcshell). The filename should consist of random 32 hex letters, e.g.: c7fdfc8f409c548a10a0a89a791417c5 (to which I will add whatever is neccesary). The point is being able to do it only…
R S
  • 11,359
  • 10
  • 43
  • 50
53
votes
1 answer

How to set an environment variable for just one command in csh/tcsh

In bash, I can set a temporary environment variable for just one command like this: LD_LIBRARY_PATH=/foo/bar myprogram Can I do something similar in csh / tcsh? I could do setenv LD_LIBRARY_PATH /foo/bar; myprogram; unsetenv LD_LIBRARY_PATH , but…
Tor Klingberg
  • 4,790
  • 6
  • 41
  • 51
51
votes
8 answers

Is there an equivalent source command in Windows CMD as in bash or tcsh?

I know that in the unix world, if you edit your .profile or .cshrc file, you can do a source ~/.profile or source ~/.cshrc to get the effect on your current session. If I changed something in the system variable on Windows, how can I have it effect…
mart2001
  • 675
  • 2
  • 7
  • 9
38
votes
10 answers

Display only files and folders that are symbolic links in tcsh or bash

Basically I want do the following: ls -l[+someflags] (or by some other means) that will only display files that are symbolic links so the output would look -rw-r--r-- 1 username grp size date-time filename -> somedir -rw-r--r-- 1 username…
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
36
votes
9 answers

How can I use aliased commands with xargs?

I have the following alias in my .aliases: alias gi grep -i and I want to look for foo case-insensitively in all the files that have the string bar in their name: find -name \*bar\* | xargs gi foo This is what I get: xargs: gi: No such file or…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
34
votes
3 answers

How can I check if a variable is empty or not in tcsh Shell?

IF I have to check that if a variable is empty or not for that in bash shell i can check with the following script: if [ -z "$1" ] then echo "variable is empty" else echo "variable contains $1" fi But I need to convert it into tcsh shell.
ramkrishna
  • 632
  • 1
  • 7
  • 24
29
votes
2 answers

Ctrl-R to search backwards for shell commands in csh

I love this shortcut in borne shell, and want to find out if it is possible to simulate and/or have (perhaps to install an add-on or with a script) it in csh or tsch thanks
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
23
votes
2 answers

What do >! and >>! do in tcsh

In normal bash redirection > redirecting standard output to a file, overwriting when it exists and >> redirecting standard output to a file, appending when it exists. In a tcsh (c shell) script I found the operators >! >>! being used. What do this…
Peter Smit
  • 27,696
  • 33
  • 111
  • 170
21
votes
5 answers

bash vs csh vs others - which is better for application maintenance?

Possible Duplicate: What Linux shell should I use? I am starting to get proficient in a Linux environment and i'm trying to pick a weapon of choice in terms of command shell scripting (as i'm still a big n00b at this) that will help me (and…
LoudNPossiblyWrong
  • 3,855
  • 7
  • 33
  • 45
20
votes
7 answers

How do I launch an editor from a shell script?

I would like my tcsh script to launch an editor (e.g., vi, emacs): #!/bin/tcsh vi my_file This starts up vi with my_file but first displays a warning "Vim: Warning: Output is not to a terminal" and my keystrokes don't appear on the screen. After I…
Marc Eaddy
  • 1,762
  • 3
  • 16
  • 23
1
2 3
46 47