tcsh is a Unix command shell based on the C shell (csh)

learn more… | top users | synonyms

12
votes
6answers
6k views

How can I automatically update the title in an xterm running screen?

This is a bit of a followup to this question. I'm working in tcsh within GNU screen in an xterm. I have the following in my .cshrc: alias res_t 'xtset -t %h:%d "(%u:%g)" %e' # reset titlebar ...
7
votes
3answers
259 views

vim can not execute unix command with :! due to shell changing

Our company uses red hat linux system and allocate everyone an account in /home. Unfortunately, our system is using tsch, which is not favorable for me. Moreover, as I do not have the super user ...
5
votes
0answers
167 views

How to make auto complete available for directories in cdpath for tcsh?

I just learned the trick for setting up cdpath in tcsh and it looks pretty useful. However seems auto-complete of sub-folder names doesn't come with it, is there any trick available on that? It'd be ...
4
votes
2answers
4k views

After-the-fact remote nohup with tcsh

I have a tcsh instance in an xterm that is running a long-term (weeks?) process. The Xvnc server it's running under went out in the weeds; it's consuming 100% CPU and is unresponsive. (This is a ...
4
votes
2answers
276 views

What's DING!? Shell prompt with time in it

I am using tcsh shell. I put time in my shell prompt. It shows me DING! sometimes, what's up with that? /home/snihalani on master at 2:55pm => /home/snihalani on master at DING! => ...
4
votes
2answers
982 views

Setting up tab-completion of paths in bash or zsh to resemble tcsh

I’m a long time tcsh user, but all the cool kids seem to be using either bash or zsh nowadays (that is, completion patterns for git or stuff are available for bash and zsh, rarely for tcsh). My ...
4
votes
1answer
4k views

In tcsh, how can I fork multiple shell commands, wait until they all complete, and then do another command?

I want to do the following from the tcsh command line, preferably in 1 line: build_cmd1 & build_cmd2 & build_cmd3 & wait until all parallel build commands finish regression_cmd That is, ...
3
votes
3answers
6k views

Redirect stdout to stderr in tcsh

From my understanding, the following should send 'test' on standard error in tcsh: echo test >&2 However, it instead writes 'test' to a file named 2, and when I look through my history, I ...
3
votes
1answer
821 views

How to get rid of errors when running find command in Linux?

I am using following command to list out 20 large files in a directory. But along with the file listing, it also shows error messages, such as permission denied. I tried adding 2> /dev/null but it ...
3
votes
1answer
452 views

In tcsh, how can I silence the output of an already running background process?

If I've launched a job into the background how can I redirect its output to /dev/null or in some way silence its output? I didn't start the job like: CMD >& /dev/null & I started it ...
3
votes
2answers
1k views

Transferring environment variable through SSH / quoting in bash/sh/csh/tcsh

I want to transfer an environment variable over SSH. The "correct" way is using SendEnv/~/.ssh/environment, but that requires the server to support AcceptEnv or PermitUserEnvironment, which it does ...
3
votes
1answer
272 views

How to save shell history more conveniently in tcsh?

I'm using tcsh quite extensively and have several questions about it's history: Is there a way to save commands for different shell tabs separately? Is there a way to save commands by session (for ...
2
votes
1answer
1k views

Can I “export” an alias to the SHELL that invoked a script?

I'm trying to write a utility script that defines certain aliases. My SHELL is tcsh (can't change that). I tried the following #!/bin/tcsh alias log 'less ~/logs/log.date '+%Y%m%d''' Then I run ...
2
votes
2answers
5k views

c shell environment variable error: “Bad : modifier in $”

I am using tcsh and define an environmental variable as follows: setenv mycomp myusername@my.computer.com so that when I need to copy files from the remote my.computer.com, I type the following: ...
2
votes
2answers
146 views

Is this alias any useful?

I am going through and old .cshrc file and it contains the following alias: alias pwd 'echo $cwd' How is that useful? I used to think that this is how pwd might have been implemented. But looks ...
2
votes
2answers
1k views

How to open xterm shells with background colors based on topographic positioning?

I currently use an alias in csh/tcsh to open shells with specific window colors. Example: xterm -geometry 105x25 -font 8x13 -bc -bg #333 -fg #999 \!* & What I'd like to do is have one command ...
2
votes
1answer
298 views

bash 4.2 autocd command default over directory

Just switched from tcsh to bash 4.2 on OSX, and autocd was what allowed me to do it. But it seems that by default if you type the name of a directory that also happens to be the name of an executable ...
2
votes
1answer
803 views

How to set PATH to run programs outside of default path?

I'm working on a project on my school's linux servers. I have a program deep in a directory, we'll say it's ...
2
votes
2answers
378 views

How to get linux to stop asking “There are # rows, list them anyway? [n/y]” for auto-completing

How do I get tcsh to stop asking if I want to list files in a directory that may have a lot of auto-completes? For example, if I do: xemacs ../"TAB" to get the list of files it asks: There are ...
2
votes
2answers
599 views

On Linux (CentOS 5), remembering when we've followed a symlink and being about to 'cd ..' out again

I'm trying to figure out how to tell the shell (tcsh) to remember when I've gone into a symlinked folder, and allow 'cd ..' to navigate back out of the symlink rather than just navigate to the parent ...
2
votes
1answer
3k views

cshell for windows

Where can I find cshell for windows xp?
2
votes
1answer
33 views

List directories without erroring if none exist

I have a rather strict set of specs for a directory listing that I need: It must list the directories in the current directory It must list purely the basename (no "./", no trailing slash) It ...
2
votes
1answer
223 views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
2
votes
1answer
408 views

In csh/tcsh, how can I incorporate literal curly braces into a command that's processed with eval?

To give more details, the situation is this. I'm trying to prepare modulefiles (i.e., of the type used by the environment-modules package) to set up environment and aliases for third-party software. ...
2
votes
0answers
82 views

Something is changing the OSX default shell to tcsh

On one of the mac machines I'm somewhat responsible for (Snow Leopard), something periodically changes the default login shell from bash to tcsh. This seems like it's probably suspicious, but not ...
1
vote
4answers
2k views

Using regular expressions and tail to execute a command

Similar to this question, in Linux tcsh I want to tail a log file and when I match a regular expression I want to execute an arbitrary command. How can I do this?
1
vote
5answers
5k views

linux text editor for windows

can somebody recommend a good Linux text editor for Windows (if it exists), I wrote scripts for C-Shell using txt editor of windows but I have problem, it doesn't run because windows is not UNIX, what ...
1
vote
2answers
340 views

“which” Program Requires Shell Refresh to See Newly Installed Programs?

Why does the Linux program which require you to refresh the shell (e.g. type tcsh in the terminal) to see new programs installed in your path?? I was baffled why I couldn't access a program, which ...
1
vote
2answers
916 views

get value of an alias in bash

I recently switched from tcsh to bash, and I'm used to being able to do things like sudo `alias netstat` but since alias gives name=value in bash, I can't do this anymore. Is there an equivalent in ...
1
vote
1answer
495 views

Linux: How to eval the contents of STDOUT?

Consider you have a file with some sort of terminal command. How might each line be executed? Can you pipe the output of more into an eval? %> more ./foo.txt Edit: After some help/guidance ...
1
vote
1answer
475 views

command limits when pasting into tcsh (mac OS X)

I encountered a 1024 character limit problem when pasting commands into the terminal application (max OS X 10.5.8) running the TC shell (/bin/tcsh). This can consistently be reproduced by pasting the ...
1
vote
1answer
343 views

Use “>>” Redirection Operator for Non-Existent File In tcsh/csh

I'm writing tcsh scripts and I would like to append to a log file, but if the log file doesn't exist before appending to it, I get an error (reproduced below). In bash the file gets created if it ...
1
vote
2answers
135 views

How do I make an alias work when I need to invoke more than one binary in the same command?

Say I have two binary files: binary1 and binary2. Each of them has its own option set: options1 and options2. Users need to invoke a command that follows this structure: binary1 options1 binary2 ...
1
vote
1answer
769 views

In tcsh, how do I disable spelling correction of my command?

Recently, when we updated our OS, we got a new tcsh feature enabled by default. Whenever I type a command that tcsh doesn't recognize, I get an annoying spelling correction like: % cats ...
1
vote
4answers
98 views

rm matching file names by pattern

I have 42000+ Project Gutenberg epubs. Often a release has both an images version and a no-images version. I want to remove the no-image copies if there is an image copy. ... pg16045-images.epub ...
1
vote
1answer
88 views

Arbitrary code execution in tcsh prompt?

I'd like to customize my prompt to include the output of an arbitrary command, like you can do in bash (e.g., I'd like to cat a file and have its (one-word) contents appear in the prompt, or show the ...
1
vote
1answer
133 views

How can I have the return string of a program appear in my tcsh prompt?

I am using vcprompt to provide me with the git branch and dirtiness status. It returns it as a string. How can I catch this string in my tcsh prompt setting? I guess I need to put the call to ...
1
vote
1answer
303 views

Is it possible to display 'special' characters in tcsh prompt running on gnome-terminal?

I'd like to know whether its possible to do special characters like so in tcsh prompt running on gnome-terminal. I remember seeing a 'skelton-head' in someone's prompt a while back. Things like ...
1
vote
1answer
183 views

history file grows indefinitely

I believe I get the same problem as this guy. I'm on AIX, with tcsh 6.12.00 After (probably) a bad logout, the history file exponentially grown, until the quota stopped it (and when the quota was ...
1
vote
1answer
52 views

How do I execute savehist for tcsh history if my machine froze?

My MacBook Air froze all of a sudden: the keyboard, trackpad and display are all unresponsive. However, ssh works. I have one tcsh session active. Which signal do I send to tcsh for it to ...
1
vote
0answers
241 views

csh: Every command returns “no match”

I'm on mac OSX mountain lion working with csh. I'm not quite sure what I did, but suddenly every standard unix command I run returns a "no match". Example: $ echo "Hello" echo: no match $ rm a.txt ...
1
vote
0answers
145 views

Why my $PATH is not inhereted by the invocked bash? [closed]

I work on an AIX system where I have no administrator privileges. It has several shells installed, default being tcsh. I am not allowed to change the login shell. Usualy I start my session from exec ...
0
votes
3answers
1k views

run tcsh but bash started instead

I tried to start a tcsh on my Fedora 7 (default shell is bash) [ss@ssvm ~]$ tcsh [ss@ssvm ~]$ echo $SHELL /bin/bash As you see, another bash shell started. I looked at the tcsh file: [ss@ssvm ~]$ ...
0
votes
3answers
2k views

Space in Directory Path in $path Variable in Linux

I am using Red Hat Enterprise 5.3, and I'm trying to add a directory to my $path variable, but it has spaces in it. The $path variable is space delimited, so how do I differentiate a space in a ...
0
votes
2answers
185 views

Copying a template header to multiple existing files

I have a bunch of *.csv files that use headers. Right now the files have headers and the same number of lines of data. I need to erase the data in these files, so I figured I could just overwrite the ...
0
votes
2answers
170 views

Ignore variables from another shell

I am on a linux workstation in a network, with an "old" distrib. Furthermore, login shell is enforced to CSH. I already asked to Admins if it would be possible to switch to another one (I would like ...
0
votes
2answers
503 views

sudo in CentOS 6.1 does not preserve command aliases as sudo elsewhere does?

On a stock CentOS 6.1 installation, if I start in my user shell (tcsh) with all my usual command aliases and do what I normally do (in other versions of Linux, and Mac OS X) to get a root shell, ...
0
votes
1answer
396 views

tcsh `cd` always issues a printout of `$PWD`. How do I disable this?

Someone in IT thought it would be a good idea to modify the default behavior of the command cd in our tcsh environment. As of Monday the "upgraded" version of cd always prints out $PWD after it ...
0
votes
1answer
1k views

Running commands as another user on their machine via ssh?

As part of my normal workflow I ssh into another user's machine, switch user to them, run a command, then exit out to my own machine again: ssh hostname sudo su user runcommand exit exit Is there a ...
0
votes
1answer
89 views

Tcsh command history

I use tcsh and have the following in my .cshrc file. But the .history file is not updated as and when I execute a command. Is there anyway so that .history file is updated every time I execute a ...