Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

1
vote
2answers
31 views

Why is SHELL pointed to /bin/sh in a Csh script?

Yes, I know C-shell is bad. No, I did not choose C-shell. Yes, I would prefer to use a proper shell. No, I cannot switch to a better shell. I have a very simplistic script: /tmp/env_test.csh #!/...
1
vote
2answers
39 views

Why can't tcsh do a single-line 'which -> vim' command?

I often have to do which command, and then open it in vim to actually see what's inside. I'd like to have an alias or function that does this, with tab completion. Here's what I've tried: superwhich()...
1
vote
0answers
38 views

Why does xterm's command line behave like this after changing the prompt?

In my .cshrc file I have the following line: set prompt="%B%n@%m [%d %T] (%h) %c3%#" When I open an xterm, I see user@host [Fri 13:37] (2) ~>0;238;0c Why is 0;238;0c there? I can't spot the ...
0
votes
2answers
68 views

Comparing 2 files using awk , not getting any results - C shell

I am using c shell and trying to compare 2 files using awk . But the below awk statement doesnt give any result. Need to acheive this solution in awk using C shell. awk 'FNR==NR{a[$0]++;next} { {...
7
votes
2answers
954 views

How to produce a PS1 prompt in bash or ksh93 similar to tcsh

In tcsh, I have the default: prompt [%m:%c3] %n%# which gives prompts like: [woehler:hacking/c/hello] ajcarr% and [woehler:~] ajcarr% In other words, the current directory and up to the next ...
0
votes
1answer
44 views

error while using sed in tcsh alias

I am unable to "source/run" my tcsh alias, which is as below: alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/\!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'" ...
0
votes
2answers
71 views

How to retrieve prompt format string in csh / tcsh

My current prompt format string is generated by an outside script that is provided by the organization. I want to manipulate it a bit (add time to the string) for that I need my current format string. ...
0
votes
0answers
172 views

tcsh: setenv and updating environment variable from script

I have a script which is supposed to check whether an environment variable exists and if yes update it using an argument read from command line. due to some limitations I should use tcsh and current ...
0
votes
2answers
64 views

What does the -l argument mean in tcsh?

I'm running a tcsh shell. I have questions about the -l option in set -l. When I look at man for the set command, I don't see the -l argument. When using tcsh shell, what does the -l argument mean? ...
1
vote
0answers
50 views

Setting default Linux Shell in RHEL7 using Active Directory

I have a client who has an install script that needs to run under /bin/tcsh as the shell on their Active Directory Domain Joined RHEL7 Virtual Machine. This install script will be run using a service ...
0
votes
1answer
27 views

Way to pass a command to Matlab from tcsh?

I'm looking to call a Matlab script in my tcsh script and pass it a programmatically-generated function call (like functionName(varName)). Is there a way to call Matlab (or any other scripting ...
1
vote
0answers
24 views

Wait for a particular duration before automatic option selection

echo "Select option: Enter 1 or 2. (1. cakes 2. coffee)" set selection=$< ... I want to wait for 40 seconds for user input. If there is no user input within this delay time, I want to ...
1
vote
0answers
68 views

Why is umask changeing

Problem: umask changes when new shell is created, despite what's in .cshrc On linux... In my .cshrc, I have "umask 002" At the prompt I see 2... % umask 2 I have a shell script... #! /usr/bin/...
0
votes
1answer
508 views

How to redirect output to file to STDOUT?

Similar problem as here How to redirect output from file to stdout? However, the solution given there is not universal. My problem: I have a command that produces output to STDOUT. At the same time, ...
4
votes
0answers
96 views

scp using a different shell?

I have a server where the default shell is tcsh. It has been setup in its .cshrc to load a number of modules on login. So it is quite slow to login and I just have to live with it. My problem is that ...
1
vote
1answer
205 views

FreeBSD: Is the default user shell `tcsh`?

I was recently reading a tutorial for tcsh and it said that the default user shell for FreeBSD was tcsh and I was surprised. For FreeBSD, is the default user shell tcsh?
0
votes
1answer
46 views

How can I find exactly which files have been accessed after a command runs in tcsh?

how can I find which files tcsh reads to TAB complete the second word of a command, as opposed to the first word. I know I can just use whereis complete to see the path to *.1.gz file, but that is ...
1
vote
3answers
160 views

tcsh alias with complex cmds, quotes and cmd arguments

I'm tying to alias a set of pipe commands, went thru some of the threads here and found that cmd line should be used differently. instead of $1 use !:1 but it doesn't seem to work for me in the below ...
7
votes
1answer
215 views

Is there a shopt glob setting or setting combo that behaves like tcsh?

I'm transitioning from being a long time tcsh user to a new bash user (it's way overdue). I wrote a lot of foreach loops in tcsh on the fly on a regular basis, so I learned the syntax for bash's for ...
1
vote
3answers
56 views

How to exclude multiple users from find command result in tcsh?

I want to exclude a group of users from find results, they don't belong to the same unix group, this is not the best way, right ? find . -maxdepth 1 -type d -name '*_pattern_*' ! -user user1 ! -user ...
0
votes
1answer
570 views

How to remove a single command from TCSH history?

I'm trying to remove a single command from TCSH history on RHEL 6, but couldn't find a way. I tried out the following Bash command as in [1], it didn't work. history -d <line_number> How can I ...
1
vote
1answer
837 views

Getting random “cd: Too many arguments.” error messages when using different commands

I am getting random "cd: Too many arguments." when using different commands, for example newgrp or when logging in. Here is a console log showing the issue along with the Linux version and shell type. ...
1
vote
2answers
111 views

Changed the alias of cd command by mistake

I changed the alias for cd command by mistake. The default alias for cd was chdir !* && setprompt before I changed it to some random command by mistake. I tried changing it back to chdir !* &...
0
votes
1answer
366 views

Can I run the nohup command from tcsh

I am looking into the nohup command and I am not sure which shells it support. It seems as if this program works differently in bash and tcsh. What I tried was something very simple. nohup --help ...
0
votes
1answer
118 views

tcsh bindkey to turn on readline variable `visible-stats`

In .inputrc I store readline commands for bash, for example: bind "\C-S": i-search-fwd I do the same in .bindings for tcsh: bindkey "^S" i-search-fwd To specify readline variables in .inputrc I do:...
1
vote
1answer
965 views

export: command not found

I'm trying to install GAMESS (a computational chemistry package) on a Linux Mint machine and the config file has a #!/bin/csh at the beginning. When I run ./config the first line is export: Command ...
1
vote
1answer
212 views

sed inside tcsh foreach loop [closed]

> foreach i ( `cat /home/chandran/scratch_r/review/1810a042/list2test` ) foreach? sed -i "/^$i /s/$/ ASAN ASAN_CUI/" testify.list foreach? end Illegal variable name.
0
votes
2answers
103 views

find with -prune leaves pruned directory names

I constructed the following find command: find ./ \( -path "*work*" -o -path "*ncvlog_lib*" \) -prune -o -type f -not -name "*.wlf" -not -name "*.vcd" -not -name "*.sim" -not -name "*vcs*" The ...
1
vote
1answer
97 views

what shell is used to run a script [duplicate]

I have some points I want to understand: I have a script written in bash syntax and does not contain the shebang line (#!/bin/bash) and my default shell is tcsh. when giving execute permission to the ...
1
vote
1answer
87 views

less command stop to work after set terminal title from .tcshrc

After I add following command to my ~/.tcshrc: echo "\033]0;${PROJECT_NAME}\007" The less command in a new opened gnome-terminal stops working properly. But more command is not affected. This is ...
1
vote
1answer
1k views

Login via ssh does not source the .cshrc file in my home directory (MobaXTerm Professional)

During my login to my Linux environment via ssh the .cshrc file in my home directory is not read. Each time I had to read this file after login via source ~/.cshrc I use MobaXTerm Professional 10.5 ...
1
vote
5answers
271 views

Pass a list of directories stored in a file to find command

From a directory and its subdirectories, one finds all the .c files by find /user/home/me/tests/ -name \*\.c Now, a list of directories are stored in a file 'list_of_dir' /user/home/me/test1 /user/...
1
vote
0answers
119 views

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 ...
1
vote
1answer
656 views

Newline in command line argument in tcsh

In bash, it is easy to pass newline as command line argument: foo 'this is a command line argument with newlines' However, if I try the same in tcsh, it complains about a missing '. How can I type ...
2
votes
2answers
2k views

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

tcsh multiline prompt/rprompt

I know that this could look like something already asked before, but I cannot have those thing work for me, maybe because I use tcsh instead of zsh. And there is no way for me to change shell, so if ...
0
votes
2answers
45 views

Obtain list of directories in hierarchy, which contain only symbolical links

I'm aware of various tools available to obtain a list of directories in hierarchy, which contain only symbolical links, but I am not proficient enough to invent a solution myself. Personally, I will ...
1
vote
2answers
993 views

If you change an environment variable in another shell will it change or stay the same in other shells?

If I create a environment variable in bash such as SPORT=baseball, then switch to tcsh and change it to "running". If I change back to bash will SPORT be displayed as "running"? (I would try it myself ...
1
vote
3answers
461 views

sed whitespace match question

I have this file - # # gridID 1 # gridtype = lonlat gridsize = 10512 xsize = 144 ysize = 73 xname = lon xlongname = "longitude" xunits = "degrees_east" yname = lat ylongname = "...
0
votes
2answers
361 views

Using the basename of current path to define a new file [duplicate]

I'm trying to make a script that creates a temporary folder with a particular name, specifically the base name of the folder I'm running the script from. To do this I've tried to do this with the ...
0
votes
1answer
191 views

Assigning / evaluating concatenated variables in tcsh

I have a tcsh puzzle, and would appreciate any help. When I run: set faceAttenRuns = (09 13) set run = $faceAttenRuns[1] echo $run This returns: echo 09. Great. But when I run: set runTypes =...
0
votes
1answer
98 views

With multiple processes, can one process (p1) send a SIGALRM timing signal that is received by two or more processes (p1, p2).?

I think I now know the answer. Since the processes p2, p3, ...., are all children of the same parent p1, then all the processes are in the same process group so any signal (e.g. SIGALRM ??) set by p1 ...
1
vote
1answer
706 views

Upon Login or exit, shell freezes for a particular user until they press Ctrl+C

we are using CentOS 6.9 and one of my users has run into an error where if they login, the screen will be frozen until they press Ctrl+C. The same thing happens when they exit. It also happens when ...
0
votes
1answer
2k views

'set' command not working on tcsh shell when called explicitly [duplicate]

The set command works fine when I type it like this: echo $0 /usr/bin/tcsh echo $SHELL /usr/bin/tcsh set START_TIME=`date +%s` echo $START_TIME 1499360060 However, it doesn't work when I call it ...
0
votes
1answer
2k views

'setenv' command not working on tcsh shell when called explicitly

I can run setenv command just fine in my tcsh shell like this: echo $0 /usr/bin/tcsh echo $SHELL /usr/bin/tcsh setenv START_TIME `date +%s` echo $START_TIME 1499355967 But, whenever I run it ...
0
votes
1answer
319 views

sed to append at specific line within certain limit only

I want to append a particular text after match of the particular line only. Currently, in example one can see I added the line rpmos xi92; can I use append switch in sed as per this workout ...
-1
votes
1answer
62 views

Can't create an alias on Cent OS 6.8

In short: $ alias search=grep $ search search: Command not found. $ alias search='grep' $ search search: Command not found. $ alias search="grep" $ search search: Command not found. Why isn't ...
1
vote
1answer
445 views

Vim mode in FreeBSD shell?

How can I switch to Vim mode in FreeBSD shell? I echoed the value of $SHELL and it is /bin/csh however man csh opens tsch's manual page. set -o and shopts are not available as well. And /etc/...
0
votes
1answer
46 views

How do I add a folder automatically to the system PATH upon login for CentOS v6.9 with TC shell?

I am accessing a remote CentOS v6.9 computer (with UltraVNC, but this detail may not be relevant). With user privileges, I want to add a folder automatically to the system PATH environment variable ...
0
votes
1answer
55 views

tcsh variable weirdness

What makes tcsh ignore chars after \fa? % set funky = "`perl -e 'print pack q(c*), 9,247..255'`" % echo "$funky" | od -x 0000000 f709 f9f8 fbfa fdfc fffe 000a 0000013 % set funky = "`perl -e 'print ...