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

learn more… | top users | synonyms

0
votes
1answer
16 views

I have a ~/.cshrc file that is sourcing another file, which should source an additional file but is not

I recently inherited an administration role for my lab and I'm still fairly new to this... so hopefully this question makes sense. Our system is set up so that one server hosts the data/user ...
1
vote
3answers
36 views

Copying multiple files on linux

I have a linux machine with folders named numerically. How can I securely copy ranges of these folders to another server? The source machine runs tcsh, the target bash. At the moment, from the ...
0
votes
1answer
19 views

How can I make printf print unicode characters saved in a variable?

I have this code to print a horizontal line using unicode character \u2501: #!/bin/tcsh set horz_line = "'" foreach x (`seq 1 1 80`) set horz_line = "${horz_line}\\u2501" end set horz_line = ...
0
votes
1answer
176 views

grep: Invalid back reference for date expression in tcsh

I googled for the following error, and didn't get any great explanations as to what was going on with grep under tcsh. (Yes, that date expression exists in the log files). $ grep '2014-07-21' *.log ...
0
votes
0answers
12 views

How to customize command completion in (t)csh?

i knew that it's related to complete built in command when you hit tab key. in the company, we have this xyz command complete | grep xyz xyz 'p/3/$$:1_$:2/' 'p/2/$abc_$:1/' ...
0
votes
0answers
36 views

linux 'precmd' error: endif: Too many arguments

I want to redirect the command lines that match a string into a file. for example, suppose i want to grep 'man' on the command lines i type and redirect(append) into a file. I am trying to use the ...
0
votes
0answers
63 views

How can my bash script inherit core limits from a C shell?

I'm using tcsh for my shell. I disable core dumps by running "limit core 0". Running a program that crashes from my shell, I can see that indeed no core dump is generated. Next I have a wrapper ...
1
vote
1answer
538 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
4answers
111 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 ...
6
votes
0answers
218 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 ...
0
votes
1answer
2k 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
2answers
588 views

Suppress 'Warning: no access to tty' in ssh

I have a short simple script, that compiles a .c file and runs it on a remote server running tcsh and then just gives back control to my machine (this is for school, I need my programs to work ...
1
vote
1answer
57 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 ...
0
votes
1answer
494 views

No entry for terminal type "xterm-256color-256color

I recently added the following (below) to .mycshrc to allow 256 color xterm and allow command line vim to operate in 256 colors, however certain command line tools like less have thrown errors ...
0
votes
2answers
277 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 ...
1
vote
2answers
140 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 ...
0
votes
1answer
125 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 ...
0
votes
1answer
366 views

Writing a tcsh script to copy files specified in first argument to a specific directory

I'm trying to write a script in tcsh that will copy select files that I specify at the command line from one directory to another without having to write out the entire path of each file. Also, to ...
1
vote
1answer
586 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 ...
0
votes
0answers
41 views

Use two different completions in tcsh

I want to make a tcsh completion that completes with both a relative directory (ie p/*/d/), or the output of a command (ie p/*/'completionterms'/). Is this possible? Looking at the tcsh man page it's ...
2
votes
1answer
36 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
288 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 % ...
3
votes
1answer
1k 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 ...
1
vote
1answer
104 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
0answers
295 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 ...
7
votes
3answers
281 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 ...
1
vote
1answer
146 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 ...
3
votes
2answers
2k 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 ...
0
votes
1answer
44 views

tcsh: how to enter a subdirectory that's most recently modified?

I found it for bash, but how would I do it for tcsh? I want to chain it with a cd command.
0
votes
2answers
185 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 ...
4
votes
2answers
324 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! => ...
2
votes
1answer
2k 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 ...
0
votes
2answers
628 views

Opening new terminal window does not pick up .cshrc

I am using KDE and Konsole. When I open a new tab, it does not pick up my .cshrc in my home directory. I am using tcsh. How I do I force re-loading of the .cshrc in my home directory without having to ...
4
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 ...
2
votes
1answer
330 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 ...
3
votes
1answer
300 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
460 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. ...
1
vote
1answer
401 views

cd Command Linux and Mystery Flags

Platform: CentOS 6.2 Shell:tcsh I'm playing around with cd for a BASH script, and noticed the wondrous cd - option, but was left with many questions... Why the cd -? Isn't this redundant with cd ...
1
vote
2answers
388 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 ...
0
votes
2answers
548 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
2answers
83 views

Running the output of script, and checking for consistency

Given a file that was output by script, is there a way to run all of those commands in order, and then check to see if the output matches what was in the script file? I assume that diff can be used ...
1
vote
2answers
973 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
0answers
147 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 ...
2
votes
0answers
83 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 ...
2
votes
2answers
392 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 ...
4
votes
2answers
1k 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 ...
0
votes
2answers
373 views

tcsh shell not autocompleting *.log files for vi

When trying to autocomplete a file name for vi, files ending in .log are not listed as options. How can I correct this?
2
votes
1answer
325 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 ...
2
votes
2answers
6k 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
624 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 ...