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

open last modified file in the directory using vi

I want a quick way to open the last modified file in the directory, perhaps in a form of alias. Currently, I do ls -ltr. Then copy-and-paste the filename Assume that I am using tcsh
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
9
votes
3 answers

How can I change my tcsh prompt to show my current working directory?

I am using tcshand I am looking for a way responsive working directory where I at least want to display the last folder name instead of getting full path. Imagine my current working directory is : …
pawankalyan
  • 211
  • 2
  • 3
  • 7
9
votes
3 answers

How to color a prompt on FreeBSD/cshrc?

I'm being put in charge of managing a bunch of servers, I want to set up my prompts on each of them so that I don't get confused as to where I am logged in to. I've edited my .cshrc files and put this in them: set prompt=`whoami`@`hostname…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
8
votes
1 answer

set command error in c shell script

I am doing this on my script: set Cnt1 =`echo $Cnt | awk '{print $1}'` set Cnt2 =`echo $Cnt | awk '{print $2}'` set Cnt3 =`echo $Cnt | awk '{print $3}'` I am getting a error saying " set: Variable name must begin with a letter." Can someone tell me…
Jack
  • 785
  • 4
  • 12
  • 19
8
votes
4 answers

TAB autocomplete python CLI

I was just wondering if it is possible to write a Python script that is run in the shell that can provide suggestions to the user when they hit Tab? for example, how certain applications can limit the file types suggested by what they support. I…
Dhruv Govil
  • 349
  • 1
  • 3
  • 13
7
votes
3 answers

multi-line variable in tcsh

I want to have variable in tcsh to hold the usage info of my script, so in my script, whenever I write echo $usage, it will print my_script -h : -help -b : do boo etc`. Is there a way to do this? Can this be done using the << EOF ? I've tried…
eran
  • 6,731
  • 6
  • 35
  • 52
7
votes
4 answers

No path in sys.path with Python and tcsh

I don't have much experience with tcsh, but I am interested in learning. I've been having issues getting Python to see PYTHONPATH. I can echo $PYTHONPATH, and it is correct, but when I start up Python, my paths do not show up in sys.path. Any…
daniel
  • 2,568
  • 24
  • 32
7
votes
1 answer

how can I recall previous commands' arguments? (in csh, and in bash?)

I usually use csh (actually my /bin/csh is linked to tcsh, an improved version of csh) and frequently use !$ to refer to the last argument of the last command. But sometimes I would like to use the last two arguments of the previous command. How can…
Chan Kim
  • 5,177
  • 12
  • 57
  • 112
7
votes
4 answers

How do I get `__FILE__` when sourcing a csh script

I have a script that is used to set some env vars in the calling csh shell. Some of those variables depend on the location of the script. If the file is a proper csh script, I can use $0 to access __FILE__ but if I run the script using source, it…
mmccoo
  • 8,386
  • 5
  • 41
  • 60
7
votes
3 answers

Gracefully Stopping Docker Containers

I'm having some trouble to understand how I can do some cleanup when the container is stopped. To make it easier, I prepared a sample to reproduce the problem. Here are the contents of my files: Dockerfile FROM opensuse:latest # Install tcsh…
amp
  • 11,754
  • 18
  • 77
  • 133
7
votes
3 answers

run csh scripts from bash, change shell temporary via command

I need to run csh scripts from a bash shell and therefore temporary change to tcsh via a command. It works perfect in interactive mode but i cant figure out in a one line command. So in interactive mode i do in the bash shell: tcsh source…
user501743
  • 199
  • 1
  • 4
  • 12
7
votes
6 answers

Escaping double quotes with tcsh alias

I'm trying to run the following commands: replace -x "must " A2input.txt replace -x " a" -f -s ## A2input.txt replace -x to -s ## -a A2input.txt replace -x faith -f "unequivocal" A2input.txt And it'd be nice if I could just alias it to something…
Anton
  • 1,387
  • 2
  • 17
  • 30
7
votes
5 answers

tcsh - save history right after command

I try to save history in tcsh after every entered command instead of saving it just after the "exit" command. This is because usually I open around 10 tabs at the same time and after it I just close the terminal window instead of typing "exit" in…
user2773143
  • 167
  • 2
  • 10
7
votes
5 answers

Tcsh and/or bash directory completion with variable hidden root prefix

I'm trying to set up directory completion in tcsh and/or bash (both are used at my site) with a slight twist: for a particular command "foo", I'd like to have completion use a custom function to match the first /-delimited term to an actual subtree…
Jeremy Y.
7
votes
4 answers

Setup Environment variable using perl

I am trying to set environment variable using Perl. It should export this variable outside (in current shell) not just in the script. I tried: `setenv X1 /p/fsd` system("setenv X1 /p/fsd") == 0 or die "failed:$?" system command "setenv X1 /p/fsd"…
user1793023
  • 117
  • 1
  • 2
  • 6
1 2
3
46 47