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).

learn more… | top users | synonyms

1
vote
2answers
48 views

How do I create a rule for custom flag replacement with C shell?

I want to have the following behavior with grep: grep --java <rest of the command> Where --java would either dynamically convert to --include=*.java or internally be equivalent to it. Is ...
1
vote
2answers
356 views

How to printf an exclamation point in tcsh?

What's the best way to printf an exclamation point in tcsh? It seems like using single or double quotes has no effect on escaping the exclamation point; and using a backspace does work, but then it ...
0
votes
2answers
371 views

Simple Script to setenv tcsh or export bash

I am having problems with simple scripting, my Box is CentOS so bash is the default shell, now I wanted to send a line via setenv (tcsh) and would like to make a script that will ask me to input a ...
6
votes
1answer
1k views

How do I prevent ssh remote login from breaking dbus?

I'm running openSUSE 11.3 on my workstation at work under KDE, I don't have root access to it. The default shell has been set to tcsh. When I am logged in at my workstation and log in remotely from my ...
4
votes
1answer
33 views

Does tcsh have an equivalent for ā€œ${a:-b}ā€ for default variable assignment like Bash?

I want to do this in one line because I want to use it in my aliases. Can I do this similarly in tcsh ? Using ā€œ${a:-b}ā€ for variable assignment in scripts There are some ways of doing it here but ...
3
votes
1answer
194 views

parametric aliases in csh to add export command

I'm trying to find a way to translate functions to csh/tcsh aliases, since they lack functions but have parametric aliases. As a first step I'm trying to create an export command. Here's what I've ...
1
vote
1answer
134 views

Why do I get the message set no match when I run this script?

#! /usr/bin/tcsh -f set ps_output = "`ps -u $user`" @ i = 2 echo "$ps_output" set ps_test while ( $i <= $#ps_output ) set line = ( $ps_output[$i] ) if ( $line[4] != "ps" && $...
1
vote
1answer
278 views

tcsh/vi-mode behavior difference between Solaris and Linux

We have both Solaris and Linux environments at work. We use tcsh as the standard shell for hundreds of users. My question is about vi-mode in tcsh: In Solaris, while I'm typing, I can backspace ...
1
vote
1answer
219 views

Why do some default bindkey keys do not work in tcsh?

I'm using tcsh and I'm seeing that some of my custom and some of the default bindkey bindings do not work. Why don't they work? For example: I load some default bindings: bindkey -e I check the ...
0
votes
1answer
24 views

how to make sure csh won't mess up your tcsh history timestamps?

I use tcsh as my default shell. Sometimes, I run csh (e.g., for testing), and it messes up my savehist history file, particularly, the timestamps -- lots of events end up appearing under the exact ...
0
votes
1answer
20 views

specify a tcsh file to source on shell initialization

I am in a shared account, and would like to fire up a tcsh shell from a command line, and specify a custom .tcshrc file to source for this shell. tcsh is being run from a bash shell. An equivalent to:...
0
votes
1answer
124 views

A script to identify whether a file descriptor has gone bad

Problem : I have a server program running which connects to a remote program using TCP sockets. There many of them (say 20). My problem is one of the socket descriptor has gone bad and has recieved ...
0
votes
1answer
77 views

mailx change the direction of the mail

I use mailx to send mails from servers to me. The problem is that it comes as RTL and not LTR. How can I define it in the command? here is the command: cat /tmp/monitor.log | mailx -s "Daily status ...
0
votes
1answer
113 views

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: ...
-1
votes
1answer
72 views

csh: Get rid of job+PID when forking

With bash I can run: $ ssh bashuser@localhost '( ls -d / nosuchfile ) & echo foo; wait' foo ls: cannot access nosuchfile: No such file or directory / If I try the same with csh I get: $ ssh ...
4
votes
0answers
23 views

tcsh shell prompt to show unfinished jobs count

How do I make my tcsh shell prompt to show unfinished background jobs? I understand %j will tell me unfinished job number count but prompt goes stale if I keep it idle. Ideally, I would like prompt to ...
3
votes
0answers
461 views

assigning a multiline variable (tcsh prompt) to another

For tcsh, I have a prompt that is multiline: set prompt = "%/\\ %n@%m[%h]% " This shows the cwd on one line and then the user/host on second line. However, with this, I cannot make a copy of that: ...
2
votes
0answers
49 views

Prevent scp and less commands reading interactive tcsh script

I'm using tsch through PuTTY, and let's start by this: please don't try to convince me to migrate to another shell...:) It's being a long time that commands like scp and less didn't work well for me. ...
2
votes
0answers
34 views

How to properly use $_ inside a tcsh script sourced from another tcsh script?

I try to retrieve the result from $_ inside a tcsh script itself sourced by another tcsh script (I'll refer to them respectively as the inner and outer script). But $_ is not set with the value I ...
2
votes
0answers
214 views

launching fish shell to new terminal of tcsh on centos

I have downloaded fish shell on my centos, but when I switch command to /bin/fish or even try to run xterm -e /bin/fish I am getting following error: Standard input: echo $_ " "; __fish_pwd ...
2
votes
0answers
33 views

Escaping output in tcsh completion by program

How do I escape output in the program providing completion? Suppose: tcsh% complete foo 'p/*/`mycomp`/' And mycomp is a Perl program printing this: #!/usr/bin/perl print "one\n"; print "two three\...
2
votes
0answers
368 views

Tcsh: Searching history using Ctrl-P and Ctrl-N

What are the equivalent functions in tcsh for the following zsh functions? up-line-or-history history-beginning-search-backward down-line-or-history history-beginning-search-forward I have the ...
1
vote
0answers
18 views

problems with running tcsh file

I can't get the following program to run. When I try running it, it says set goal = `head -c 15 < /dev/urandom | base64 | sed 's/[^0-9]//g' | sed' Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ]...
1
vote
0answers
48 views

How can I make tcsh echo the time that a command is executed, before it is executed?

I would like tcsh to print the time that each command is executed, preferably in the right-hand column of the screen. This is similar to what rprompt can be used to do with the following setting, ...
1
vote
0answers
192 views

Add entries to an array inside a loop

I am trying to update an array in a linux tcsh script. The script uses a while loop, and I want to add elements to the array every time the loop iterates. Is there a better way to do this? #!/bin/...
1
vote
0answers
31 views

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 ...
1
vote
0answers
119 views

Unicode emoji not showing up in tcsh prompt

I set my prompt on tcsh 6.18.01 to use some silly emoji characters, but they don't show up. > cat .cshrc set prompt = '\nšŸ”„ [%~]\n%# ' \360\237\224\245 [~] ...
1
vote
0answers
205 views

Properly defining a multi-line prompt in tcsh

I am trying to configure my prompt in tcsh to make it multi-line (i.e having one line provide system info, and the next line the one where I type commands). Currently I have the following: set ...
1
vote
0answers
108 views

How to make tcsh not insert whitespace in a command that spans multiple lines

Bash does not seem to insert whitespace but tcsh does. Tcsh bash-3.2.25$ tcsh -c 'echo $tcsh; echo A\ > B' 6.14.00 A B Bash bash-3.2.25$ bash -c 'echo A\ > B' AB How can I ask tcsh to not insert ...
0
votes
0answers
19 views

Define root prompt and non root prompt in one rc file

I'm writing a restore script for my dotfiles and I find it really irritating that I have to have two .tcshrc for both root and user where they only differ by one line. Is there a way of defining the ...
0
votes
0answers
19 views

tcsh prompt changes with change of directory

I am trying to change my prompt to be permanent no matter what directory I am in. I put set prompt = "%n@%M %T>" in my .cshrc and upon opening a console it looks as expected. However as soon as I ...
0
votes
0answers
94 views

Meaning of three dots in default terminal window in Debian

I have a debian machine, and each time when I login and open the terminal, the default window used to start up with [mgiri-deb7-64:~]1 % However, yesterday, I used putty to login into this ...
0
votes
0answers
82 views

why are directories which are empty not removed after rmdir?

foreach file (`find . | awk -F/ 'NF == 3'`) echo $file set olddir = `echo $file| cut -f 1-3 -d '/'` echo $olddir set newdir = `echo $olddir | cut -c 1-2,5-` echo $newdir mkdir -p $newdir ...