Questions tagged [tcsh]

tcsh (TENEX C shell) is a shell for Unix-like operating systems and an enhanced, but completely compatible version of the Berkeley UNIX C shell (csh).

tcsh (TENEX C shell) is a shell for Unix-like operating systems. It is an enhanced, but completely backwards-compatible, version of the Berkeley UNIX C shell ().

From their website:

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.

Website: http://www.tcsh.org/Welcome

Man page: http://linux.die.net/man/1/tcsh

Wikipedia: http://en.wikipedia.org/wiki/Tcsh

Similar

309 questions
5
votes
1 answer

Operate on command output in tcsh

I think the correct operator for executing subshell command in tcsh is the backtick ` but when I attempt to do a diff on the results of two commands I get an error. When I direct the information to files first and do a diff on the two files I get…
4
votes
2 answers

Running a full foreach command

I'm trying to run a foreach loop within just 1 line of code instead of typing each indivdual command like below; Set n=0 ; foreach txt ( *_*.txt) foreach? sed “s/_/-/g” $txt foreach? @ n ++ foreach? End echo You changed $n files Is there any way to…
r0bb077
  • 165
  • 1
  • 1
  • 7
4
votes
2 answers

tcsh: i-search-back character glitch

As seen in a few other answers, I added this to my .cshrc to make CTRL-R behave similar to bash: bindkey "^r" i-search-back It works fine in general. My problem is that when doing CTRL-R followed by a left or right arrow (to edit the line), it will…
simark
  • 143
3
votes
2 answers

scp does not auto-complete in the same way as other commands

I am using tcsh. I found that when I do scp mytab, it doesn't autocomplete to my-file.txt under the current directory I have to prefix a ./ there to make it complete. This seems to only happen with scp. I tried other commands, it seems to work…
wei
  • 203
3
votes
2 answers

problem with loading tcshrc

I have ubuntu 16.04 installed on my local pc and I'm trying to make my work environment as similar to the way it is configured at my job to achieve that I wanted to use the same tcshrc file (yes, we use tcsh, not sure why...) anyway, when I try to…
2
votes
1 answer

How do I set a variable as the user id

I want to write a start up script in tsch that creates a directory some where named with the current user id. I was hoping the following would work. Set A = (id -u -n) But I'm not sure how to handle the output of the command id properly for this…
2
votes
3 answers

loop through file by row in tcsh

This is a very similar question to How to loop over the lines of a file?. I have a file with rows with n fields, separated by spaces. I want to loop through this file by row, and use the set the fields as variables, for use in calling information…
ZakS
  • 305
2
votes
3 answers

Multi-line PATH in tcsh

Inspired by the accepted answer to this thread, I am trying to replicate a similar construction in tcsh (version 6.14.00) with no luck: setenv new_PATH ( /some/path /some/other/path # Some comments /foo/path # Another group /bar/path $PATH) #…
2
votes
0 answers

tcsh and matching [0-9]

I have a rather odd situation where [0-9] matching is not working under tcsh (but working under csh and bash). here is an example: muon:~/tmp.52 ls a0 a1 a2 a3 a4 a5 a6 apollo_help.docx* muon:~/tmp.53 ls a[4-9] a0 a1 a2 a3 a4 a5 …
2
votes
0 answers

How can I make tcsh's "postcmd" not execute typed command if the postcmd command fails?

In bash, when I implement precmd() functionality via trap ??? DEBUG, I can make the typed command fail to execute, if the command in precmd() call returns non-zero return code; by using set -o functrace and shopt -s extdebug. I'm trying to implement…
DVK
  • 321
1
vote
1 answer

Configure cshrc to set paths for specific dirs

There are various paths I need to set whenever I cd into a certain directory. I'm hesitant to just set them in my .cshrc file, because I may need to point them somewhere else if I'm working in a different dir. Is there a way to set things up so my…
JETM
  • 139
  • 1
  • 8
1
vote
1 answer

Making tcsh history isearch case-insensitive

How do I make tcsh's history isearch (ctrl-r) case insensitive? I tried "set complete=igncase" but that affects file completion, not history isearch.
user2267
0
votes
2 answers

How to print whole array in tcsh

I want to print the whole array in tcsh, because then i want to pipe it to uniq, is there a way to do it in tcsh. i had set array and was printing it: echo "$array" but it ended up with error: Word too long, it works for smaller arrrays, Is there…
Ricsie
  • 111
0
votes
2 answers

using awk with variables in a shell script

I have a file called "random" that looks like this: A B C D A B C D A B C D How can I get this shell script to print up the second column? #! /usr/bin/tcsh -f set variable = "2" awk '{print "$""'"$variable"'" }' random It…
ZakS
  • 305
0
votes
1 answer

Changing terminal prompt in `tcsh`

My terminal shell prompt defaults to [johnnine@tec ~]$. How should I use "set prompt" in ~/.cshrc, so that it also displays time?
1
2