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
0 answers
17 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 ...
user avatar
8 votes
2 answers
763 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 ...
user avatar
0 votes
0 answers
16 views

Installation packages no longer found after updating my Mac to 12.2.1

I'm using tcsh shell to access installation packages for my research. After a recent update, my login shell is no longer able to find where those installation files are located. I receive a prompt ...
user avatar
  • 1
0 votes
1 answer
33 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 ...
user avatar
1 vote
1 answer
70 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 ...
user avatar
  • 23
0 votes
2 answers
96 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" ...
user avatar
  • 275
1 vote
1 answer
343 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 ...
user avatar
  • 275
2 votes
1 answer
45 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 ...
user avatar
  • 41
0 votes
1 answer
39 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?
user avatar
0 votes
1 answer
43 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 ...
user avatar
2 votes
2 answers
234 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 ...
user avatar
0 votes
0 answers
35 views

Can I configure bash to collapse multiple spaces in command history?

I used tcsh for a few decades and one thing I liked about it is that if I had multiple spaces in a command line, they would be collapsed when that command was placed in the command history. This made ...
user avatar
0 votes
0 answers
89 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 ...
user avatar
  • 1
-1 votes
2 answers
68 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 ...
user avatar
0 votes
1 answer
43 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 ...
user avatar
  • 275
0 votes
0 answers
475 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="%{\...
user avatar
0 votes
1 answer
140 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 "...
user avatar
1 vote
2 answers
257 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 ...
user avatar
  • 7,487
1 vote
0 answers
44 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:~/...
user avatar
0 votes
0 answers
33 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 ...
user avatar
  • 101
0 votes
3 answers
289 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 .....
user avatar
-3 votes
1 answer
116 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 ...
user avatar
0 votes
1 answer
86 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] ...
user avatar
1 vote
1 answer
233 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 ...
user avatar
0 votes
0 answers
103 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 ...
user avatar
  • 63
1 vote
1 answer
688 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 ...
user avatar
  • 63
0 votes
2 answers
210 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 <...
user avatar
  • 63
0 votes
1 answer
63 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 ...
user avatar
  • 423
1 vote
1 answer
76 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 $ ...
user avatar
  • 13
2 votes
1 answer
442 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-...
user avatar
  • 63
5 votes
1 answer
2k 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 ...
user avatar
  • 161
0 votes
1 answer
406 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:~$...
user avatar
  • 1,221
3 votes
1 answer
146 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 = `...
user avatar
0 votes
1 answer
45 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 ...
user avatar
  • 423
0 votes
2 answers
44 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 &...
user avatar
  • 423
0 votes
1 answer
100 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 ...
user avatar
  • 3
0 votes
2 answers
203 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. ...
user avatar
0 votes
0 answers
94 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 ...
user avatar
0 votes
0 answers
28 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 ...
user avatar
  • 423
1 vote
1 answer
708 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 ...
user avatar
0 votes
1 answer
139 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....
user avatar
  • 1
0 votes
1 answer
1k 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 ...
user avatar
  • 63
0 votes
1 answer
267 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 ...
user avatar
  • 63
0 votes
1 answer
274 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:...
user avatar
1 vote
1 answer
108 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 ...
user avatar
0 votes
0 answers
192 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 ...
user avatar
0 votes
0 answers
45 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. ...
user avatar
0 votes
0 answers
324 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. ...
user avatar
  • 21
0 votes
2 answers
62 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 = ...
user avatar
  • 3
1 vote
1 answer
40 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 ...
user avatar

1
2 3 4 5 6