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
4
votes
1 answer

echo nested quotation marks in tcsh

I have a tcsh script that generates a text file. One of the lines in the text file is: bla bla bla 'foo foo foo "bar bar bar"': etc etc; Note the nested ' and " and also the : and ; that must be there. The : and ; require the whole string to be…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
4
votes
2 answers

(tcsh) postcmd alias for xterm titlebar breaks less texteditor

I set up my tcsh xterm to update the titlebar on "postcmd" with the name of the last command that was run and the directory. This is similar to what I had (minimal example to reproduce): alias postcmd 'echo -n "\033]0;hello_world\007";' (note that…
Tim
  • 35,413
  • 11
  • 95
  • 121
4
votes
2 answers

edit commandline with $EDITOR in tcsh

Today's Daily Vim says this: Assuming you're using the bash shell, the following can be helpful when composing long command lines. Start typing on the command line and then type Ctrl-x Ctrl-e, it should drop you into your system's default editor…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
4
votes
3 answers

Shell test to see whether a binary is in your path

In csh, tcsh, bash, perl (etc) you can do tests on par with (not necessarily with the same syntax): test -e PATH; # Does PATH exist test -f PATH; # Is PATH a file test -d PATH; # is PATh a directory ... Does a similar construct exist for checking…
Brian Vandenberg
  • 4,011
  • 2
  • 37
  • 53
4
votes
1 answer

Environment variable set in tcsh script is not available for bash script

I have a bash script and a tcsh script, my tcsh scripts sets some environment variables and those variables are not available for bash subsequent steps after tcsh script execution. Any suggestion how to make environment variables set in tcsh…
Naga
  • 444
  • 2
  • 7
  • 18
4
votes
3 answers

How can I set environmental variables in bash using setenv?

I've a file containing all the environmental variables needed for an application to run in the following format... setenv DISPLAY invest7@example.com setenv HOST example.com setenv HOSTNAME sk ... How would I set the env. variables in bash using…
4
votes
3 answers

In python 2.4, how can I execute external commands with csh instead of bash?

Without using the new 2.6 subprocess module, how can I get either os.popen or os.system to execute my commands using the tcsh instead of bash? I need to source some scripts which are written in tcsh before executing some other commands and I need…
Ross Rogers
  • 23,523
  • 27
  • 108
  • 164
4
votes
1 answer

tcsh if/then statement gives error

I'm trying to do a simple tcsh script to look for a folder, then navigate to it if it exists. The statement evaluates properly, but if it evaluates false, I get an error "then: then/endif not found". If it evaluates true, no problem. Where am I…
Kayson
  • 425
  • 3
  • 15
4
votes
3 answers

tcsh random number from /dev/random and /dev/urandom

I am trying to figure out how to generate random from using /dev/random and /dev/urandom in tcsh. After I do head -c 1 /dev/random, I get a random byte. How do I turn this byte into actual number?
Hien
  • 1,769
  • 3
  • 18
  • 17
4
votes
3 answers

Tcsh and Bash Initialization

I would like to be able to source a file to set up some environment variables, but do it so it's independent of the shell being used. For example %: source START.env # START.env if [ $SHELL == "bash" ]; then source START.env.bash # sets…
elmt
  • 1,604
  • 14
  • 24
4
votes
1 answer

Is it possible to get a timestamp without invoking an external command like `date`?

zsh builtin print has option -P to perform prompt expansion, and this could be used to get the current time. I wonder if there are other ways to achieve this? And how about for other shells?
oxnz
  • 835
  • 6
  • 16
4
votes
1 answer

bash vs. tcsh alias argument passing

I used to have this alias in tcsh to find files on the filesystem. alias findf 'find . -name \!* -print' How do I write this in bash shell?
gaitat
  • 12,449
  • 4
  • 52
  • 76
4
votes
1 answer

How to find script directory in an included shell script

We now to find the directory of a shell script using dirname and $0, but this doesn't work when the script is inluded in another script. Suppose two files first.sh and second.sh: /tmp/first.sh : #!/bin/sh . "/tmp/test/second.sh" /tmp/test/second.sh…
Taha Jahangir
  • 4,774
  • 2
  • 42
  • 49
4
votes
2 answers

Bringing gvim to foreground

I am trying to make an alias for gvim that opens a file in a new tab using vim-server, the alias (for now) is: /util/Linux/bin/gvim --servername $VIMSERVER --remote-tab-silent !* While this is working, it leaves the gvim window in the background. I…
Alex Biba
  • 63
  • 5
4
votes
2 answers

Passing arguments to "executable" parameter of the subprocess.Popen() call

The subprocess.Popen() lets you pass the shell of your choice via the "executable" parameter. I have chosen to pass "/bin/tcsh", and I do not want the tcsh to read my ~/.cshrc. The tcsh manual says that I need to pass -f to /bin/tcsh to do that. …