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
1answer
31 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 ...
0
votes
0answers
20 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="%{\...
1
vote
1answer
50 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 "...
-1
votes
0answers
40 views

“Illegal variable name” error while I'm trying to install and configure Docker on FreeBSD

I'm a new freebsd user,I'm looking inside the Freebsd ecosystem for the tools that usually I use in Linux. At the moment I'm trying to install and configure docker and I found this tutorial : https://...
1
vote
2answers
65 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 ...
1
vote
0answers
34 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:~/...
0
votes
0answers
25 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 ...
0
votes
3answers
76 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 .....
-3
votes
1answer
85 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 ...
0
votes
1answer
55 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] ...
0
votes
0answers
8 views

Preserve tcsh history in multiple terminal windows without growing command numbers

In an old question, Preserve tcsh history in multiple terminal windows, one issue remains unresolved: How does one immediately maintain the command history between multiple terminal sessions without ...
1
vote
1answer
38 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 ...
0
votes
0answers
28 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 ...
1
vote
1answer
106 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 ...
0
votes
2answers
50 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 <...
0
votes
1answer
31 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 ...
1
vote
1answer
42 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 $ ...
2
votes
1answer
86 views

How to escape all of the special characters in order to be able to print the string as is?

I'm creating a tcsh script on the fly (with a static language). I have a <add-command-here> section that contains some command. I want to do: echo <add-command-here> In that <add-...
5
votes
1answer
698 views

When defining an environment variable, I get “Command not found”

When I type HELLO="hello", I would expect to create an environment variable called HELLO. Instead, I get the error HELLO=hello: Command not found. What could be going wrong here? I am on ...
0
votes
1answer
92 views

for loop in FreeBSD (pfSense) doesn't work

I've just noticed that the same code for for loop in bash doesn't work in FreeBSD wolf@linux:~$ echo $SHELL /bin/bash wolf@linux:~$ wolf@linux:~$ for i in {1..3}; do echo $i; done 1 2 3 wolf@linux:~$...
3
votes
1answer
85 views

tcsh grep trouble

I use FreeBSD > uname -sr FreeBSD 6.3-RELEASE When I query > grep `whoami` /etc/passwd It shows me the information I want: But when I try getting it in a tcsh script: #!/bin/tcsh set login = `...
0
votes
0answers
13 views

What is the practical difference between these options for tcsh completion?

I know, I know, I shouldn't be using TCSH. But I must and so here we are. I'm trying to understand tcsh's complete command for tab completion, and finding it hard to make sense of the documentation ...
0
votes
1answer
20 views

xterm is calling .cshrc twice

I'm running ubuntu 18.04, I've asked this question on askubuntu, but got no response, so I thought I'd ask on a different forum, hoping for a different readership. I do know that the same problem ...
0
votes
0answers
37 views

tcsh history contains junk charecters

In tcsh shell. When we do ctrl+c junk charecters getting printed in history. Contents of /etc/.cshrc are below # vi /etc/.cshrc set TERMINAL=`who am i | nawk '{print $NF}' | tr -d '()'` set history= (...
0
votes
2answers
40 views

sourcing in bash doesn't mimic sourcing in tcsh

The file below, which I've called /tmp/ltSortedList, when sourced in tcsh, outputs lines in different colors: echo "\033[0;34m R:0 2020 12 10 18:53 regularFile "\\e[0m echo &...
0
votes
1answer
52 views

PATH behaves differently in bash and csh when directory is execute only?

We have some applications in various subdirectories that we limit access to by unix group, and we want them to be execute only. So, for example, if we want members of the "chem" group to ...
0
votes
2answers
111 views

Execute a command in a separate konsole then let users type commands

I am working on software at a large corporation where I have little control over the overall technologies used, and as a result need to find solutions that will work within the constraints I have. ...
0
votes
0answers
13 views

tcsh complete command for TAB completing inner folders from a given one

I'm trying to make TAB to work like that: kill_date folder_name sub_folder_name folder_name - is a folder in a specific path. sub_folder_name - is the inner folder inside folder_name (which is the ...
0
votes
0answers
12 views

Prevent tcsh history printing multiple times

History of commands is getting printed multiple times when exiting the session and logging again. when using below in .cshrc alias postcmd "history -M; history -S" My .cshrc looks like ...
0
votes
0answers
85 views

Delete duplicate entries from history file with tcsh

I am trying to remove duplicate entry(of command with same timestamp) from history file. my .cshrc file looks like below, set TERMINAL=`who am i | nawk '{print $NF}' | tr -d '()'` set history= (1000) ...
0
votes
0answers
57 views

Ambiguous output redirect error in find command [duplicate]

Apologies if this is a repeated question, I am trying to search for a file in all the subdirectories in a given path. While doing so I also want to suppress any output messages, errors from the find ...
0
votes
0answers
20 views

history manipulation in tcsh, substitute every match

I know everybody will tell me that I should switch from using tcsh to bash or something else, but hysteresis is a powerful force, so I'm not going to. Most of the time I find tcsh perfectly ...
1
vote
1answer
351 views

Is there a way to disable history for one command in TCSH?

I am executing a command in TCSH, which requires me to pass a password on the command line. Obviously, I would like it not to be saved in the history file. I know that other shells like Bash supports ...
0
votes
1answer
106 views

why tcsh script choke on special characters inside file eg. #{ on a line is giving missing “}” error

I'm using tcsh shell script to read each line of a file input.txt script #!/bin/tcsh set out_file_length=`wc -l<$1` set i=1 while ( $i <= $out_file_length ) set each_line = `head -$i input....
0
votes
1answer
617 views

How to iterate over all of the files and directories in a directory?

I'm trying to iterate over all of the files/directories in a directory. That includes also all of the hidden files (without . and ..). From previous topic in Bash it was suggested to use: for current ...
0
votes
1answer
83 views

How to declare an array of items in tcsh that separates on multilines?

I'm trying to declare an array of items in tcsh that separates on multilines. I tried: set ignore_array = ( 'a' 'b' 'c' ) Also tried: set ignore_array = { 'a', 'b', 'c' } how ...
0
votes
1answer
84 views

Can't create an alias in tcsh shell when trying to sed some string with .*

I'm trying to create this alias in tcsh shell: alias repeat 'zgrep -i __NCELAB_SNAPSHO \!* | grep -v make | grep -v Flags | sed 's#CODE_COVERAGE_TYPES.*TEST_DONE=1##g'' And getting an error: alias:...
1
vote
1answer
105 views

How to understand which shell a particular code belongs to without knowledge about the shell?

I get to understand that this code is for bash shell for f in $file.docked.[0-9][0-9][0-9] do mv $f $f.pdb done And this code is for tcsh shell foreach f ( file.docked.[0-9][0-9][0-9] ) mv $f ...
0
votes
0answers
80 views

How to change directory from environment variable in tcsh?

I have captured a linux path into an environment variable. Now I want to change the directory to the path in that environment variable. Lets say the environment variable is named: gr I can see the ...
0
votes
0answers
42 views

How do I use spaces in my command to cd to a directory and its sub directories using aliases?

Suppose I am interested in this directory: /home/username/../../../../.....dummy1 And dummy1 has these subfolders: sub_dummy1 sub_dummy2 that in turn can consist of various directories and so on. ...
0
votes
0answers
244 views

macOSx / what is the kernel variable os_refcnt counting and what might be causing it to overflow?

Trying to figure out why running some software that I am developing causes my Mac to do a panic restart every 16 h or so always with an "os_refcnt" kernel variable overflow when running tcsh scripts. ...
0
votes
2answers
49 views

How to add a specific line in a file to the end of the specific line in another file? (use sed maybe)

I have a file, supermaster.PRM: num_valid_az = 12194 nrows = 12194 first_line = 1 deskew = n caltone = 0.000000 st_rng_bin = 1 Flip_iq = ...
1
vote
1answer
26 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 ...
1
vote
1answer
308 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. It ...
0
votes
2answers
40 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
330 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 ($...
1
vote
2answers
94 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
53 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
139 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
164 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

1
2 3 4 5 6