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

Filter by
Sorted by
Tagged with
1
vote
1answer
5 views

Getting tcsh dextract-like pushd functionality in bash

I love bash (4.1.2(1)-release) but I strongly prefer the way tcsh implements pushd +N with the dextract option enabled, so much so that I refuse to use bash as my default shell because of it. Has ...
0
votes
0answers
16 views

csh/tcsh Tab Completion with “complete = enhance” Strange Behavior

set complete = enhance is put in .cshrc, and we have two files, test_ab_dd.c and test_abc_dd.c. If I type test_ab_<TAB> in the command line, csh DOES NOT autocomplete to test_ab_dd.c. I have to ...
0
votes
2answers
39 views

Should this be two separate lines?: `. echo “test” set dat = $dcmdir/$s/scan.log`

I'm looking at a tcsh script in which one of the lines is: . echo "found scan.log, finding mprages" set dat = $dcmdir/$s/scan.log That's all on one line. Is it feasible that this is actually valid, ...
0
votes
0answers
23 views

Where is the history of a particular tab stored in the TCSH shell and how can i exchange it?

when I close a shell tab, in tcsh, the history save automatically to ~/.history. all the history of all tabs save to the same file. but if I run history command I get the local history of my specific ...
0
votes
0answers
10 views

Why is tcsh's history storage behaviour inconsistent between Linux variants?

When I write a loop in an interactivetcsh, e.g. foreach f ( `find dir/ -type f` ) foreach? mv "$f" "$f".bak foreach? end then want to re-create or write a similar command later on: foreach f ( `...
0
votes
0answers
76 views

pipe into if then in csh/tcsh

I would like to have a csh script to test a variable between two pipes. For example (the incoming resembles a json file but without the newlines and indentations): set debug = 1 cat test.inp | if ($...
0
votes
0answers
28 views

csh: run a command before all terminal commands, but not for commands in sourced files

I'm currently using the csh postcmd alias to run a command before each terminal command is executed. However, I've found that this command also gets executed for every line in a sourced file. For ...
1
vote
2answers
57 views

Drop stderr from ls

When I run ls on a filename that doesn't exist the output reports that. I'd like to drop that output but still report when a file is found. Is this stderr that reports the output below? $> ls foo ...
0
votes
1answer
42 views

How to set PATH to symlinked directory in bash csh

I have the directory /data/bin and in my home directory is symlink /home/myuser/bin -> /data/bin I have set PATH into the /home/myuser/bin/ When /home/myuser/bin is the directory, the PATH works fine,...
0
votes
1answer
65 views

override value of $_ in linux csh script

I would like to override value of $_ in linux csh script. I run this script in xterm using cmdline: chmod +x test.csh test.csh test.csh content: #!/usr/bin/tcsh .... source sourceme.rc .... ...
0
votes
2answers
32 views

cd on the last folder tcsh

trying to cd on the last directory in bash if im trying this : cd $(ls -l | tail -l) it will result in : Illegal variable name. I'm not sure how I should do this
2
votes
1answer
90 views

How can I alias 'emacs file.txt' to 'emacs file.txt &'?

In case this is an XY problem, what I'd like to do is always open Emacs visually as a background process, but still get tab completion and not have to append '&' manually. I'm in Tcsh, no way to ...
0
votes
2answers
1k views

exec /bin/tcsh produces a “if: Expression Syntax.” error

We have two servers: test box with Oracle Linux 7.6 and production box with Oracle Linux 7.7. Running the exec /bin/tcsh command produces two different results. On the test server: # exec /bin/tcsh ...
0
votes
1answer
124 views

tcsh: search entire array for a variable

I am modifying a suite of scripts written in tcsh. Unfortunately, these scripts can't be rewritten because the program they interface with is also written in tcsh. I just want to get out of the way ...
0
votes
1answer
79 views

How to enable “extended_glob” in tcsh?

I am looking to enable 'extended_glob' in tcsh shell and I tried these commands: setopt extended_glob shopt extended_glob But , None of these worked. Can anyone let me know a way to enable this in ...
1
vote
1answer
54 views

Override hostname for mail(1) in a shell script

I'm trying to quickly send some stuff to myself from my MacBook, but I'm having issues with my server rejecting the SMTP connection due to the unqualified domain name in the from field. I've tried ...
2
votes
1answer
160 views

How to make tcsh multiline prompt use newline character?

Scenario I like to use a multi-line prompt. set prompt="${bold}${green}%M${white}:${red}%c5${unbold} \n${white}% " I quite often copy/paste terminal lines into Windows emails. Problem It appears ...
0
votes
1answer
250 views

Ambiguous redirect when running command via ssh

I'm trying to start a program in the background on a remote server via ssh, but this program must be run from the directory it is contained within. I tried doing the following ssh -q user@server 'cd ...
0
votes
2answers
182 views

How to split and access fields delimited by colon?

This piece of code: foreach line (`cat /etc/group`) echo $line end returns line containing 4 fields delimited by :. How to split fields and access the first field of each line?
1
vote
0answers
83 views

cd /bad-directory ; source junk.1 logs me off!

I thought I knew unix/bash etc. The compound statement USING TCSH! cd /lkjsdf ; source junk.1 completes and then logs me off IF the cd directory does not exist. It works fine if the directory ...
1
vote
2answers
185 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
54 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
60 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
83 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
1k 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
150 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
319 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
547 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
127 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
120 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
48 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
116 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/...
1
vote
1answer
1k 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
188 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
309 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
67 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
397 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
349 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
95 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 ...
1
vote
1answer
1k 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
1k 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
166 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
638 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
178 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
2k 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
308 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
269 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
118 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
117 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
2 3 4 5