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

0
votes
1answer
36 views

Split xls file into small xls files [on hold]

I want to split the sample.xlsx (containing 3 sheets) file into the 3 different sheet1.xlsx sheet2.xlsx sheet3.xlsx files , I have John McNamara Perl package repositories VERSION = 2.37. I am adding ...
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
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
28 views

What is special about printf over echo

I was finding length of a variable as below: `set num=123456` `echo $num|wc -c` it returned output as 7 (suppose to return 6) I did same with printf `printf "%s" $num|wc -c` it returned output ...
0
votes
1answer
36 views

set alias for a directory

I am trying to set an alias that would allow me to quickly cd to the following directories: /home/user/asreera/Aravind/sample/src /home/user/asreera/Aravind/sample2/src First I set the variable: ...
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 ...
1
vote
0answers
15 views

Show last three directories in the prompt [duplicate]

I am trying to set prompt of the shell to show atleast last 3 directories. I am using the following to show present working directory, set prompt = " %~>" (Home directory will be replace with ~ ...
0
votes
1answer
35 views

tcsh preserve newlines in command substitution `…`

So, I wrote a simple script to convert sh-style export key=value statements to csh-style setenv key value for docker-machine env. #!/bin/sh docker-machine env | sed -e 's/export/setenv/' -e 's/=/ /' -...
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 ...
0
votes
1answer
27 views

Setting up command promt in tcsh to show only last 3 working directory instead of complete path?

I have command prompt in tcsh that shows the current working directory. The problem is that the command prompt becomes very big once I am in a deep hierarchy of folders. How do I set the command ...
0
votes
1answer
18 views

Why does the prompt differ for `tcsh` depending on whether it's invoked as `tcsh` or `csh`

I installed the tcsh package on Ubuntu 15.10 and the prompt differs depending on how I invoke tcsh. First off, on Ubuntu 15.10, tcsh and csh really are the same executable: $ cmp /bin/tcsh /bin/csh &...
0
votes
3answers
45 views

`tcsh` repeat with subshell

I'm trying to figure out how to repeat a complex command inside a repeat in tcsh, like so repeat 9999 (curl http://localhost:80/index.php; echo) I am using a subshell here instead of { and } ...
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. ...
0
votes
1answer
41 views

Why is this script not copying the files inside my source directory?

I am running a script with two arguments. myshell.sh source destination So I want to copy all the files (not including subdirectories) inside the source directory and copy them to the destination ...
4
votes
1answer
32 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 ...
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 ... ]...
0
votes
0answers
18 views

How to change default shell on Solaris? [duplicate]

I am a user of a Solaris system which I log into as a standard user with no root or administrative privileges. The default shell for me appears to be bash. How can I change this to tcsh? I only ...
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:...
1
vote
2answers
47 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 ...
0
votes
0answers
92 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 ...
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 ...
0
votes
1answer
23 views

dynamic window title from command input (TCSH)

I am looking for a way to dynamically set the window title based on the command input. For instance, if I run elinks I want the window title to be set to elinks. I did search a lot, but all the ...
1
vote
1answer
24 views

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 ...
0
votes
1answer
41 views

Comparing a variable to upper and lower case letters

So I want to validate a response of a user in tcsh script and that's what I have so far set var1="temp" while($var1 != [yY] && $var1 != [Yy][Ee][Ss] && $var1 != [Nn] && $...
0
votes
1answer
38 views

TCSH: I want to display command output and redirect to a file

I looked at the TSCH man page, which said "Either output-file or error-file may be '/dev/tty' to send output to the terminal." So if I can redirect to two different locations, that would work. But ...
1
vote
1answer
133 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
80 views

Updating a git variable in the Shell prompt on every command

I am running TCSH and I would like to update my prompt every time I run a command. I think can currently do that via backticks. set tmpstr = `git status --untracked-files=no --porcelain` set ...
1
vote
0answers
46 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, ...
2
votes
1answer
99 views

ls after cd in tcsh?

I cannot seem to find an answer to this question. In my .bash_profile I have this line: cd() { builtin cd "$@"; ll; } which executes ll every time I change directories. I would like this ...
1
vote
2answers
38 views

how to move by a word in command line in tcsh?

let's say the command is "ls word1 word2 word3" I want to move the cursor from end of line to "word2" but do not want to clear "word3" in process. Just jump back by two words and reach beginning of "...
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 ...
7
votes
3answers
113 views

'switch' based on shell

I would like to source (i.e. not call) a script from any shell (bash/csh are the primary targets, but fish, zsh, ksh, and rc would also be interesting). I would like if the script can be a single ...
1
vote
1answer
21 views

Disable printing all possibilities in tcsh on TAB

Earlier, in my shell, on pressing TAB, I would directly see the directory path completed to the best length possible. But now, after upgrading to centos-6 I see that it also prints all possible names ...
1
vote
1answer
81 views

Ignore full lines with sed

I've searched high and low across the internet, but I can't seem to find an answer that satisfies this question - I need to use sed to display all lines in a file, excluding a group of them. I'm not ...
2
votes
2answers
1k views

pipe stdout-to-file with wc

I'm working on a lab assignment for a class, which exemplifies users | wc -w as displaying the number of users currently logged in. The instructor has asked we write the output of users to a file (...
0
votes
0answers
34 views

What are the advantage of using tcsh? [duplicate]

I'm a newbie to Linux. I have found tcsh has some advantages over bash. What are the significant advantages using tcsh over bash? For C Programmers is there any specific advantages that bash cannot ...
0
votes
3answers
86 views

How do I create a directory for every file in a parent directory

I have parent folder and inside this folder I have 4 files ParentFolder File1.txt File2.txt File3.txt File4.txt I wanted to create subfolders inside the parent folder and ...
1
vote
1answer
48 views

tcsh display cursor on next line

I have been trying to get hold of this since many days. Essentially what I need in my tcsh is this [machine_name:current_dir]72 % instead of [machine_name:current_dir]72 % so that I can ...
6
votes
3answers
518 views

Why is the manual for 'where' command not available

I recently came across the command where, which provides the actual path of executables in Linux. I was aware of which, whereis, locate and find, but not where. I want to know when this command got ...
2
votes
2answers
103 views

Reliably identifying the path to the directory containing the running script

There are plenty of answers in SO to address this question: Can a Bash script tell what directory it's stored in? Unix shell script to find out which directory the script resides? And there are a ...
4
votes
2answers
2k views

Inconsistency of stderr redirection between tcsh and other shells

I'm running into issues with redirection in tcsh. Consider the following commands: vi --version and vi --xxx. And let's assume this is on a machine where vi supports the --version option. The ...
4
votes
3answers
1k views

How to check if string is blank in tcsh

How can I check whether a string is empty in tcsh? Before you freak out, no I'm not writing shell scripts with tcsh. I am asking because I want to use this in my .tcshrc file. Specifically, I want ...
1
vote
2answers
53 views

tcsh: make 2-digit hours in prompt

I am attempting to simply get a standard lexigraphical time display in the prompt and the history file in the range of 00:00:00 to 23:59:59. I've tried set prompt=%P$ but this just produces, for ...
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 ...
0
votes
6answers
1k views

sed to replace with backspace

I have trail.txt, which contains spice netlist. Now I want to replace all expanded parameters to one line only i.e. remove + and append that line to previous line. trail.txt data + net06706 ...
1
vote
1answer
200 views

setenv from awk in tcsh

I am trying to set environment variables one per line from awk: $ <source command> awk '/inst/ { n = split($0,a,"/"); cmd = "setenv " a[n-1] "_ver" $0; system(cmd) }' However the out I get is ...
0
votes
1answer
195 views

What does dollar underscore mean in tcsh? $_

In a script I'm debugging, I see it use $_ at the beginning of the file. It appears to suck in the full command that called the file. When trying to wrap this script in another script though, the $_ ...
3
votes
6answers
2k views

redirect output to specific line number

I want to grep certain lines by keyword and redirect the output to specific line number of an existing file. Command grep "key" temp_file >> desired.txt What I need is that I can append the ...
-1
votes
1answer
71 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
2answers
359 views

status check for sleep command

I have run sleep command in background as follow , How can I know the status of execution ..? Command sleep 2d ; find /home/disk1/ -exec touch {} \; & How can I know that its executed for 1 ...