Skip to main content

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

tcsh piping ONLY stderr to null leaving stdout alone

running a tcsh in RHEL-8.10. doing a grep -l <something> * I get a bunch of Is a directory responses. in bash I would do grep -l <something> * 2>/dev/null to suppress that. What is the ...
ron's user avatar
  • 7,239
0 votes
1 answer
29 views

cleartool command not found from .cshrc but found when manually called

I'm having an issue with cleartool commands called from my .tcshrc. I try to call cleartool setview, but get a cleartool: Command not found error. however, when I call the command from the terminal, ...
Clinton J's user avatar
  • 101
3 votes
1 answer
247 views

tcsh: Handle spaces in arguments when passing on to another command

I wrote a script that needs to call a command and pass on arguments. My script has its own parameters but some need to be passed through. This fails when arguments to my script have spaces in them. ...
Ned64's user avatar
  • 8,924
0 votes
1 answer
52 views

TCSH tab auto complete with the part of current typed command

I am trying to write my own complete for a command. The completion needs to use a portion of the typed command to for a path search. I am trying to get the following behavior When I write my_commad -...
Dan Messer's user avatar
2 votes
1 answer
297 views

Enabling command hashing in tcsh

It seems command hashing is disabled by default in our tcsh environment, and I'm not permitted to get it enabled across the board. Instead I'm looking to enable command hashing within individual ...
Maikol's user avatar
  • 165
1 vote
1 answer
71 views

Force tcsh to check whether command exist in the path before attempting to execute it

I've noticed that tcsh, regardless of whether "-f" flag is passed on the shebang line, will iterate through $PATH, and try to execute the command from that path until the command is found. ...
Maikol's user avatar
  • 165
0 votes
0 answers
51 views

linux tcsh scripting question

I am writing a linux tcsh script to check the syntax of a command argument to insure its correct before the command executes. Out of the 9 fields I have saved as variables in the script, I am able to ...
Brian's user avatar
  • 5
0 votes
1 answer
45 views

How can wildcard expansion create duplicates?

I have a directory with an absurd number of files, which makes this nigh impossible to understand by inspection. But here's the situation: cp giant_folder/pre* myfolder It's crunching along and ...
Mastiff's user avatar
  • 101
1 vote
1 answer
144 views

Converting a tcsh alias into zsh

I had a tcsh alias as follows: alias cdd 'cd `dirname \!*`' I use this to change the directory to the one containing a certain file. For instance, cdd /Users/myself/Document/Folder/File.pdf would ...
leparc's user avatar
  • 13
1 vote
1 answer
403 views

DISPLAY=:0: Command not found

user@domain:~ $ echo $DISPLAY :0 user@domain:~ $ DISPLAY=:0 DISPLAY=:0: Command not found. Just trying to run the command here: https://stackoverflow.com/questions/46810043/notify-send-doesnt-work-...
ProgrammingFreak's user avatar
3 votes
2 answers
128 views

Bash equivalent of tcsh M-$?

Way back while studying I used tcsh as my main shell and it had this nifty feature of being able to correct a misspelled command name by pressing Escape-$ which would the. change eg “bsah” to “bash” ...
Thorbjørn Ravn Andersen's user avatar
0 votes
1 answer
27 views

tcsh equivalent of bash command (deleting all but 10 most recently modified directoies)

Below keeps latest 10 directories and delete the rest. Works fine with bash. What would be TCSH equivalent to bash below? keep = 10 rm -r $(ls -dt */ | tail -n +$((keep+1)))
Aldron's user avatar
  • 1
0 votes
0 answers
113 views

tcsh way of pattern substitution

I am using tcsh shell with Jenkins. In short, the matching suffix should be removed from the output. Achieved in bash with the following. cd ${WORKSPACE%${JOB_NAME}} Case: Given the following ...
Aldron's user avatar
  • 1
0 votes
1 answer
374 views

Replace backslash path for forward slash path with sed in loop

I want to replace windows server paths (\\100.100.0.0\aaa\bbb\ccc\) with linux paths /foo/bar/ on all occurrences inside all .txt files in a folder (/xxx/yyy/zzz/). For that I made a loop that does ...
CodingPear's user avatar
0 votes
0 answers
219 views

I am writing a cronjob, I need a command that confirms that some of the files are successfully transferred from an MFT server to my local server

I use the following command: sftp -o "StrictHostKeyChecking" -r -P [portNumber] technicalUser@hostName:/path/2022* /LocalPath After I execute the above command, all of the files which start ...
Kawhi Goat's user avatar
1 vote
1 answer
109 views

How to search DuckDuckGo with the command-line (tcsh)?

There is a simple function I use a lot to look up things on the web In Fish function ddg set URL "https://duckduckgo.com/?q=$(echo "$argv" | tr " " "+")" ...
user avatar
0 votes
0 answers
265 views

recursive history search for tcsh shell

In bash shell, i generally use CTRL+R to fuzzy search a command that i executed recently. However the same doesn't seem to work for tcsh or csh shells. I want to understand if/how to do the same ...
Anuraag Tummanapally's user avatar
0 votes
1 answer
640 views

How to pass a variable to a sed command in a csh script?

Unix & Sed noob here! I have a requirement where I need to put a suffix ",waive" in case a line in a report containing a matching string.The matching string is part of another file "...
Aditya's user avatar
  • 3
2 votes
0 answers
826 views

How to redirect the stderr to /dev/null and the stdout to the pipe in tcsh?

I have the following code in tcsh: set dirs = `find $path -follow -name "test" | grep -v ".data"` It will find all the directories that have test directory under it, without ...
vesii's user avatar
  • 203
0 votes
0 answers
229 views

C shell and mesa installation

I am trying to install mesastar following these instructions: http://user.astro.wisc.edu/~townsend/static.php?ref=mesasdk I do not have C Shell from prerequisites. I have Linux mint and tried sudo apt-...
Anna-Kat's user avatar
  • 135
0 votes
3 answers
67 views

put text along with unix command then feed to a file

In the tcsh shell on Unix, I would like to print the folder name together with the number of files that I searched, then feed it to a file. However I just manage to find the number of count then write ...
Grace's user avatar
  • 103
1 vote
2 answers
1k views

while command not working when bash script is sourced in tcsh?

I had made a bash shell script which include while command but when I run the script using source command on terminal, it gives a syntax error message. I need to use source because I have to set the ...
vikas's user avatar
  • 19
2 votes
1 answer
682 views

In tcsh, how can I keep '{' '}' in assigning a variable?

I am making a simple shell script using the tcsh shell. I assigned a variable as a command to use later. But brackets within single quotes disappear. set aaa = "test '10' '{}' ' " ; echo $...
aroman's user avatar
  • 23
0 votes
0 answers
205 views

using 2 alias together in cshell terminal

lets say I have 2 aliases, each having multiple arguments. It looks somewhat like below example alias s1 "command1 -a -b -c" alias s2 "command2 -d -e -f" now if I run :s1 s2 in ...
Krishanu Banerjee's user avatar
8 votes
2 answers
2k views

Avoiding non-zero exit code when running `ls` using multiple patterns

Say I have two possible paths I want to list directories and files under on a Linux machine: /some/path1/ /some/path2/ If I do the following in tcsh, I get 0 exit code, if at least one of path1 or ...
shikhanshu's user avatar
0 votes
1 answer
43 views

how to translate this bashrc code to suse 11 commands

I am trying to link MATLAB with Cadence Virtuoso (an electrical engineering software) in SUSE Linux 11, and I have manual PDF that is the guide to do so. My problem is that the commands that are given ...
TheDeparted's user avatar
2 votes
1 answer
777 views

tcsh scripting - keep newlines of grep results

I am writing a simple script in tcsh (apparently that's a bad idea, but well) to grep some patterns from a text file. Say we have a file animal_names.txt which consists of: dog carrot dog bolt cat ...
Hanz's user avatar
  • 33
0 votes
2 answers
2k views

using awk with variables in a shell script

I have a file called "random" that looks like this: A B C D A B C D A B C D How can I get this shell script to print up the second column? #! /usr/bin/tcsh -f set variable = "2" ...
ZakS's user avatar
  • 315
2 votes
3 answers
4k views

loop through file by row in tcsh

This is a very similar question to How to loop over the lines of a file?. I have a file with rows with n fields, separated by spaces. I want to loop through this file by row, and use the set the ...
ZakS's user avatar
  • 315
2 votes
1 answer
100 views

Debian tcsh not respecting locale for character class expansion

Using Debian 11, tcsh version tcsh 6.21.00 (Astron) 2019-05-08 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,nd,color,filec In a directory with two files, a and A, $ echo [a-z] a A This ...
Jon's user avatar
  • 51
0 votes
1 answer
1k views

Changing terminal prompt in `tcsh`

My terminal shell prompt defaults to [johnnine@tec ~]$. How should I use "set prompt" in ~/.cshrc, so that it also displays time?
WitchPath's user avatar
0 votes
1 answer
62 views

Running a program with the same as an existing command

Let's say I make a runnable program called "xeyes.exe" in my current directory. When I type the command "xeyes" into the command prompt, why does the program run instead of the ...
WitchPath's user avatar
1 vote
2 answers
1k views

Use bash instead of tcsh for non-interactive shells

I have an environment similar to the one in this question: Different shells for interactive and non-interactive work I'm currently stuck with tcsh as my "official" default shell. For ...
Chris Weber's user avatar
0 votes
1 answer
483 views

Behaviour of single and double quotes depending on shell

I've been scratching my head for quite some time with this.... Inspired by this answer, I'm trying to run 'ack' and to find either a single quote or a double quote in source files. Doing this in bash ...
DaveC's user avatar
  • 1
-1 votes
2 answers
115 views

Syntax to select a group of files based on extension?

I have several files in the following form, Group - 1 file1.n001 file2.n002 file3.n003 file4.n004 : : : filex.nx Group - 2 file1.ntemp file2.nreal : :etc In order to remove only files, with ...
The_Learner's user avatar
0 votes
1 answer
214 views

Access the shell printout that resulted from the previous command

I have to run a command that prints out a message in my shell, with a path to a file. >> myCommand.py >> outputs path to file I'd like to know if this message is stored anywhere so that I ...
ZakS's user avatar
  • 315
0 votes
0 answers
3k views

C-shell prompt color

I wan to change the color of my csh shell. I've edited my .cshrc file, following the instruction I've found here, and included this in it: set yellow="%{\033[1;33m%}" set end="%{\...
Mr.Seven's user avatar
0 votes
1 answer
339 views

TCSH: 'Can't find string terminator' Error From perl -e in TCSH Script

I'm seeing this error from my tcsh script and I can't figure out why. Script: #!/usr/bin/env tcsh foreach n (0 1) set PERL_CMD = "perl -e 'print qq^RUNNING^; exit ${n} '" echo "...
ercousin's user avatar
1 vote
2 answers
877 views

How to quote exclamation marks in file names in a tcsh shell script with find and awk?

I have a script that searches for space characters ' ', exclamation marks '!' and dollar signs '$' in filenames and replaces each with an underscore '_'. However, it does not handle file names with ...
Ned64's user avatar
  • 8,924
2 votes
0 answers
95 views

tcsh and matching [0-9]

I have a rather odd situation where [0-9] matching is not working under tcsh (but working under csh and bash). here is an example: muon:~/tmp.52 ls a0 a1 a2 a3 a4 a5 a6 apollo_help.docx* muon:~/...
itstime2b's user avatar
0 votes
0 answers
92 views

How can I prevent standard output from displaying as a standard error in csh or tcsh?

When executing a process in the background using '&', the standard output goes to standard error. This happens if an error is detected in the standard error output when executing a command, or if ...
leto's user avatar
  • 101
1 vote
3 answers
1k views

Applying numfmt on a specific column in awk

I'm writing a script in tcsh (yes... I know but I have to) to analyze all users disk usage in a specific directory. In the end, I want to produce a report in the next format: user1 1.6GB user2 1.1GB .....
Michael S's user avatar
-3 votes
1 answer
298 views

Issue processing multiple files, counting lines

Sorry if it's long and confusing, but I have three files, namely cat, dog, and cow. My code is something like this: echo -e "Enter file name: \c" read filename #saves ...
Wenhan Xiao's user avatar
0 votes
1 answer
1k views

Count number of lines in file and save result to new text file [closed]

I want to count the number of lines in a file called "cat" my script to run in CMD is echo -e "Enter file name: \c" read filename wc -l $filename which leads to result [24 cat] ...
Wenhan Xiao's user avatar
1 vote
1 answer
8k views

loop with array in TCSH shell

In TCSH : I'm giving two lists containing different files in it. Then I have to pass those list as an array element and then the loop should execute twice as there are only 2 lists. But in this case ...
user466919's user avatar
1 vote
0 answers
854 views

How to run command with tcsh and keep the shell alive?

I'm using tcsh. I want to open a new interactive tcsh shell and run command. I want to do it like: tcsh -c <command> The problem is that tcsh executes the command and exits the interactive ...
vesii's user avatar
  • 203
3 votes
1 answer
3k views

Using single quotes inside input of heredocs

I need some help debugging my tcsh script. It uses heredocs. The code: <pre_setup> <<EOF1 <setup> <<EOF2 <command> exit 0 EOF2 exit 0 EOF1 The <pre_setup> is ...
vesii's user avatar
  • 203
0 votes
2 answers
951 views

What does it mean <<EOF in (t)csh?

I have the following command: wash -n <groups> <<EOF echo hi echo bye <<BYE <commands> exit 0 BYE exit 0 EOF <commands> where <groups> are some groups and <...
vesii's user avatar
  • 203
0 votes
1 answer
162 views

assign letters to jump forward and backward in bash

My default shell is tcsh. In my .cshrc file. I have bindkey -v, so that at the command line, the letters b and w jump backwards and forwards a word, respectively. I'd like to set up bash so that ...
Leo Simon's user avatar
  • 453
1 vote
1 answer
128 views

recover a directory moved into itself

Through shell shortcuts I accidentally moved a dir into itself and now it seems to have disappeared. Here is the sequence cut-n-pasted directly from the terminal: $ chmod a+x load_test_set.sh ~/bin $ ...
JimK's user avatar
  • 13

1
2 3 4 5
7