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
19
votes
2 answers

How can I echo commands in a tcsh script?

Yes. I know I shouldn't be using it for scripting. Yes. It is rubbish. I am indeed a fool. Nevertheless. I'd like to see the commands the script is executing, for debugging purposes. I think you get this effect with set -x or set -v in bash…
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
19
votes
5 answers

Linux alias chain commands (can recursion be avoided?)

I've been looking around for ways to alias clear and ls into one command. Currently I've defined command x: alias x="clear;ls" Now is there any walkaround to avoid recursion and define: alias ls='clear;ls'
GoTTimw
  • 2,330
  • 6
  • 26
  • 34
19
votes
3 answers

Redirect Standard Output/error to log file

Looking for a way to redirect std error and std output to a log file in Tcsh shell. Tried ./ShellFile.sh 2>&1 | pathToLogFile.log and got the error "Ambiguous output redirect" Would appreciate any inputs.
Piyush Mattoo
  • 15,454
  • 6
  • 47
  • 56
18
votes
2 answers

Redirecting stderr in csh

I'm executing a program that dumps crash report into STDERR from where I have to filter some necessary information. The problem is that I'm unable to redirect STDERR to STDOUT and PIPE it with grep command 2>&1 >/dev/null | grep "^[^-]" >&…
PYPL
  • 1,819
  • 1
  • 22
  • 45
16
votes
2 answers

python subprocess.call() "no such file or directory"

I've found a few questions on the module but the more common problem seems to be getting the argument list right which I think I have managed (eventually) I am trying to run a program that expects an input like this in the command line, fits2ndf in…
user1889259
  • 245
  • 1
  • 3
  • 7
15
votes
1 answer

Expand aliases in non-interactive shells

In bash, we can use shopt -s expand_aliases to expand aliases in scripts. What are the equivalent commands for zsh, csh, and tcsh? Do they even exist? In focusing my efforts on zsh, I haven’t found such a command. I even tried sourcing the file with…
user137369
  • 5,219
  • 5
  • 31
  • 54
15
votes
2 answers

Unix tcsh - alias using command line argument $1 versus \!:1

In Unix (tcsh), I've referenced command line arguments in my aliases with two different notations - $1 and \!:1. But I noticed that if I try to save $1 to an environment variable, it doesn't get saved. However \!:1 does get saved. alias hear 'setenv…
itchmyback
  • 549
  • 2
  • 4
  • 11
15
votes
1 answer

"Event not found" error for shell command in unix

when i am trying to remove consecutive duplicate lines with awk "!x[$0]++" file its reporting x[: Event not found. even the same case with sed -i -e "$!N; /^\(.*\)\n\1$/!P;D" file as well reporting N: Event not found. i tried with single quotes…
user1228191
  • 681
  • 3
  • 10
  • 19
13
votes
1 answer

Exit tcsh script if error

I am tryin to write a tcsh script. I need the script exit if any of its commands fails. In shell I use set -e but I don't know its equivalent in tcsh #!/usr/bin/env tcsh set NAME=aaaa set VERSION=6.1 #set -e equivalent #do somthing Thanks
ARM
  • 363
  • 1
  • 7
  • 18
12
votes
4 answers

Bash's equivalent of Tcsh's ESC-p to jump to command starting with what you typed so far

I recently made the insanely long overdue switch from tcsh to bash. The only thing I miss is tcsh's ESC+p feature: Start typing a command and then hit ESC+p (I actually found the equivalent ctrl-[p easier to type) and it jumps to the most recent…
dreeves
  • 26,430
  • 45
  • 154
  • 229
11
votes
4 answers

How can I find the location of the tcsh shell script I'm executing?

Say I put an executable tcsh file in /path/to/my_script.csh and my current directory is anywhere, for example I'm in /path So I type to/my_script.csh I want to have a line in my_script.csh that will return "/path/to/my_script.csh" - like ruby's…
Julian Mann
  • 6,256
  • 5
  • 31
  • 43
11
votes
3 answers

How to map Delete and End keys on tcsh shell?

I use tcsh , and when Delete/End is pressed on cmd line, it simply shows up as ~ ; I have to press to go to end of line. Can anyone help me to be able to use Delete/End keys as their name suggests ?
TCSGrad
  • 11,898
  • 14
  • 49
  • 70
10
votes
1 answer

Assigning command output to a shell variable

I am trying to assign output of a cut command to a variable, however I am running into a strange problem. I am using tcsh shell. $echo $0 tcsh This is the command I am running: $set a=`cut -f2 -d' ' test.txt` Missing }. //This is the output I am…
Richeek
  • 2,068
  • 2
  • 29
  • 37
10
votes
5 answers

Specify command line arguments like name=value pairs for shell script

Is it possible to pass command line arguments to shell script as name value pairs, something like myscript action=build module=core and then in my script, get the variable like $action and process it? I know that $1....and so on can be used to…
Neeraj
  • 8,408
  • 8
  • 41
  • 69
10
votes
2 answers

Bad : modifier in $ (/)

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/my/lib error: Bad : modifier in $ (/) echo $SHELL /bin/tcsh I want to add my library to LD_LIBRARY_PATH variable. But Gives the above error.
elif mutlu
  • 103
  • 1
  • 1
  • 8
1
2
3
46 47