Questions tagged [csh]

csh, or the C shell, is a command interpreter with a syntax reminiscent of the C programming language.

Quoted from the Solaris csh man page:

csh, the C shell, is a command interpreter with a syntax reminiscent of the C language. It provides a number of convenient features for interactive use that are not available with the Bourne shell, including filename completion, command aliasing, history substitution, job control, and a number of built-in commands. As with the Bourne shell, the C shell provides variable, command and filename substitution.

csh first appeared in 2BSD, and was originally created by Bill Joy. While Bourne shells are more popular, csh-style shells are still fairly popular especially in the BSD community & academia.

is an an enhanced version of csh, almost all versions of csh encountered nowadays are actually tcsh.

Programming in csh is a controversial topic. For one viewpoint, see this article.

1173 questions
0
votes
1 answer

How to execute the results of a pipe in csh?

I need to execute the results of a pipe, but without using a temp file (the pid needs to stay the same...dang screwy regression system). So, if I have a test file that contains: echo Do this I ideally want to run something like: cat test_file |…
SDGator
  • 2,027
  • 3
  • 21
  • 25
-1
votes
2 answers

Parse and format the Data in bash or C-shell

I have the input data in below format from command and I need to parse it using foreach loop or awk or any efficient technique to get desired output as shown below. Input Data: General Information Job = Job1 Workstation Folder = /test/ …
sandy
  • 55
  • 8
-1
votes
1 answer

I want to use 'sed' command (for example) that have two variables. One should be evaluated and other not

I want to use 'sed' command (for example) that have two variables. One should be evaluated and other not. For example, var1="should be evaluated" var2="should not be evaluated" echo "should be evaluated" | sed 's|${var1}|$var2|g' I want to see:…
Alex
  • 29
  • 5
-1
votes
1 answer

Use shell variable in grep lookahead in csh

I am trying to utilize a grep lookahead to get a value at the end of a line for a project I'm working on. The main issue I'm having is that I'm not sure how to use a shell variable in the grep lookahead syntax in cshell Here's the gist of what I'm…
OmniMan
  • 1
  • 1
-1
votes
2 answers

Alias for cd in Linux csh

I used to have an alias for cd in csh, which can show the current time and directory at the beginning of the cmdline and trigger the ls command. The effect is like this: [10:24] /home/cambridgelv/Desktop/cd .. Desktop Documents Downloads …
-1
votes
1 answer

Remove duplicate records from a csv file considering single column

I have a file with records in such a type- ,laac_repo,cntrylist,idlist,domlist,typelist 1,22DE17,BA,S6CD6728,24JA13,6A 2,12FE18,AA,S6FD7688,25DA15,7D 3,22DE17,BA,S6CD6728,24JA13,6A 4,12FE18,AA,S6FD7688,25DA15,7D I want to remove duplicate records…
Saurabh
  • 1
  • 3
-1
votes
1 answer

Csh Variable declaration

Unable to echo $varible_$variable in csh set a = temp set value_${a} = 10 when trying to print the variable it isn't working. I need this to implement in nested for loop. echo $value_$a value_: Undefined variable. (working with $value_temp) Thanks…
Harry
  • 1
  • 1
-1
votes
2 answers

How to remove the same directories/names from two strings /list?

I am writing a c-shell script, where I am grepping two different directories in two strings. I wanted to remove the name of the directories which are the same. I only want the unique directory among the two by leaving out the duplicate ones. I am…
-1
votes
2 answers

freebsd: Illegal variable name

I am trying to run the following command: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" but getting: Illegal variable name. How to fix it?
Shery
  • 1,808
  • 5
  • 27
  • 51
-1
votes
2 answers

Awk Program to Determine Maximum

I'm trying to determine the maximum values of columns S2 & S4 but only for the corresponding S1 columns that have BBB. The output would be S2 max=800 and S4 max=90. Currently have: awk 'BEGIN { FS = " " ; OFS = " "; } { if(NR%3==0){max=$3} {…
entropee
  • 163
  • 1
  • 1
  • 8
-1
votes
1 answer

Display the command that is being executed in cshell

I am using csh where i want to display the command that is being executed. I can see find something like set -x placing at the beginning of the script. But it seems to only work for bash. In cshell i am getting following error. set: Variable name…
Naga
  • 59
  • 8
-1
votes
3 answers

Print line every four lines from an file

I have a file that contains 8000 lines, I want to print lines 1,4,8,12,...,7996. I tried this code for j in {1 .. 8000} do k= $((4 * $j)) print k sed -n $k P test.dat >> test.dat1 done but this error appears: ./test.csh: line 3: 4 * {1: syntax…
-1
votes
1 answer

Trouble pipelining grep into a sort

I have data in file in the form: Torch Lake township | Antrim | 1194 I'm able use grep to look for keywords and pipe that into a sort but the sort isn't behaving how I intendended This is what I have: grep '|…
-1
votes
3 answers

How can I invoke both BASH and CSH shells in a same script

In the same script, I want to use some CSH commands and some BASH commands. Invoking one after the other giving me problems despite I am following the different syntax for respective shells. I want to know where is mistake in my code Your…
A.Chandra
  • 1
  • 2
-1
votes
1 answer

How do I input paramters into a Jenkins perl script from command line?

Background I am running a Jenkns Job, called Job A, that feeds its build parameters into a perl script, called ScriptA.pl, in the following format below: #Check the input params my $PARAM1 = $ENV{ "PARAM1" }; my $PARAM2 = $ENV{ "PARAM2" }; .....more…
isakbob
  • 1,439
  • 2
  • 17
  • 39