The C shell (csh), once one of the two major Unix shells with the Bourne shell. Csh had more advanced interactive feature but has been surpassed by modern Bourne-style shells such as zsh and bash.

learn more… | top users | synonyms

1
vote
0answers
50 views

How to use ! in the sed command?

Apologize if you feel this question very basic. Anyways, I am typing sed '/[iI]t/ a\\ Found it!' data but it says the error event not found. I tried escaping that ! with backslash \! but it doesn'...
0
votes
1answer
29 views

awk accepting variable supplied by dollar sign in cshell [duplicate]

In c shell script, I'm trying to pass bbb to awk sub, but apparently it does not work. #!/bin/csh set aaa=a set bbb=b #And I'm using it in awk sub set ccc=`echo $aaa | awk '{sub("a",$bbb); print $...
-4
votes
0answers
24 views

How to determine current users who are logged in using a specific domain? [duplicate]

I want to know How to determine current users who are logged in using a specific domain? For example, here is the question. Please tell according to it using the grep command and use of wc. ...
-6
votes
1answer
49 views

How to determine current users who are logged in using a specific domain? | UNIX [closed]

I want to know How to determine current users who are logged in using a specific domain? For example, here is the question. Please tell according to it using the grep command and use of wc. ...
0
votes
1answer
48 views

`source …/settings.csh` not working from `sh ./test.sh`

I want to source Xilinx ise setiin64.csh file with the source command. I have source /home/xilinx/ise_14.5/14.5/ISE_DS/settings64.csh in another file, test.sh. So I want to run only test.sh file ...
1
vote
1answer
21 views

What is the exact difference between a .login and .cshrc file?

I have searched the internet and websites say that we can edit both the file as per our needs and first .cshrc file is executed and then the .login file. That is fine but what is the exact ...
1
vote
4answers
99 views

/bin/ls: Argument list too long

I am a biology person and running a program named autodock. I have some files from ZINC library in .mol2 format. As per requirement I need to split this files with the csplit command and I received ...
1
vote
2answers
49 views

ulimit command not found (without sudo) and error - coredumpsize: Can't set limit (Operation not permitted)

When i initially login to a server, I see the following error message. ullimit: coredumpsize: Can't set limit (Operation not permitted) Further, when I try to copy files into this machine, I see ...
2
votes
2answers
68 views

bash:Syntax near unexpected error '(' [closed]

I am following a tutorial in computational microbiology: William Lindstrom, Garrett M. Morris, Christoph Weber, and Ruth Huey (2008-01-29). Using AutoDock 4 for Virtual Screening. Scripps Research ...
1
vote
1answer
87 views

Simple if command not working in csh script

I have made a basic shell script using IF command as a purpose to help myself as I am a beginner. Problem is that when I execute this script using source overspeed (after giving myself execute ...
2
votes
1answer
30 views

Automatically set number in vim without modifying vimrc because of limited permission

Hi since I dont have permission to modify vimrc. But I really need to view the line numbers every time. Is there an alternative way to do the following without modifying the vimrc file?Thank you! :...
1
vote
2answers
33 views

Cronjob runs a script which calls another script

my cronjob look like this: 0 3 * * 0-6 somedir/promotionscript But promotionscript is actually calling another file "config" located in the parent folder of somedir. #promotionscript #!/bin/csh ...
0
votes
1answer
30 views

how to make sure csh won't mess up your tcsh history timestamps?

I use tcsh as my default shell. Sometimes, I run csh (e.g., for testing), and it messes up my savehist history file, particularly, the timestamps -- lots of events end up appearing under the exact ...
0
votes
1answer
10 views

make ${m} ARCH=${ARCH} >&! Make_${m}

I am new player in Linux. In this command (C shell script) make ${m} ARCH=${ARCH} >&! Make_${m} what does >&! mean?
0
votes
1answer
36 views

Get parent directory in cshell script

Hi I'm trying to get parent directory in cshell script but the following code found not working in cshell script: #!/bin/csh -f set dir=$PWD set parentdir="$(dirname "$dir")" Error info: Illegal ...
0
votes
0answers
61 views

Why alias could not be found in the shell

I was trying to set the alias for command: {cutadapt -O 24 -q 19,19 -m 30 -g TATAGAATTCGCGGCCGCTCGCGATAATACGACTCACTATAGGGCGTTTTTTTTTTTTTTTTTTTTTTTT -g ...
1
vote
1answer
61 views

error:too many words `` in cat

I have a csv file that auto-generate with filename format yy-mm-dd_h. The csv file content: Status Filename 1 1A-W02_ws_r0_apr13_15_44.stdf 1 2A-W04_ws_r1_apr12_10_30.stdf 1 1A-...
1
vote
0answers
54 views

C shell. Make script wait for Gnome-terminal to finish

I am working on a script that has to process a lot of data. All comes down to 3 commands. I use: #!/bin/csh gnome-terminal -e "ssh $servername1 'command 1'" & gnome-terminal -e "ssh $servername2 ...
1
vote
0answers
31 views

Adding corresponding elements from two arrays into new array using csh shell?

I want to use a csh script to merge corresponding elements of two arrays into another array. My script gives error as:- arrayfinal[1]: No match. the results is 0 0 0 0 0 my script is #!/bin/csh ...
1
vote
2answers
51 views

How do I create a rule for custom flag replacement with C shell?

I want to have the following behavior with grep: grep --java <rest of the command> Where --java would either dynamically convert to --include=*.java or internally be equivalent to it. Is ...
2
votes
1answer
98 views

What kind of redirection is >>&?

I'm looking at a cron file that has the following line: 35 0 * * * /bin/csh -c "/home/abc/.cshrc;/home/abc/appTools/bin/xxx.pl >>& /home/abc/appTools/log/xxx.cronlog" Is this another ...
1
vote
0answers
45 views

Read and write line from .txt, in CSH script [closed]

well I have to do a basic script,is mandatory in csh, and I decided to do a simple "task manager". Based on a .txt file, the user can add task, show tasks, delete X task. The problem I don't manage to ...
0
votes
1answer
267 views

Unwanted question mark appended to directory name when using mkdir

I am unsure why when I use mkdir -p $fbase an unwanted ? is appended to the name of the directory (27obs87St01Rec1?) . I have followed similar threads and ran cat -A filename to see if there are ...
1
vote
0answers
38 views

Piping to 'tee' commands prevents changes in environment variables

I have a csh script using which I modify certain environment variables and echo values of these environment variables from within this script. I source this from another script: source "$...
1
vote
0answers
49 views

Setting environment variable using shell script

I am using csh scripts for some automation purpose. I have a number of scripts, and the beginning of all of which I need to set a fixed set of environment variables. |----SCRIPT 1---| |----SCRIPT ...
1
vote
1answer
59 views

cshell alias: How to use nested single quotes(') in in cshell alias

I am trying below alias in cshell: alias sll 'ls -l \!* | grep -oE '[^ ]+$' | paste -s | xargs ls -l' For this CSH says, Illegal variable name. If I use \$, alias will be set without any error. ...
3
votes
1answer
479 views

Odd alias “find . -name '*\!{*}*' -ls” in Unix Power Tools

From Unix Power Tools 3rd Edition page 175: Article 9.27 shows a way to match directories in the middle of a path. Here's a simpler "find file" alias that can come in very handy: alias ff "...
2
votes
0answers
44 views

unix c-shell : disk checking

im totally new in shell scripting. I have task to simplify an old c shell script. Basically, the script have 10 devices that using hp-ux and i want to check the disk space in each devices. my ...
1
vote
1answer
62 views

C Shell Script syntax error “unexpected end of of file”

I am trying to write a c-shell script that checks for number of arguments and echos a string, but I am getting an unexpected end of file syntax error and I don't understand why. Here is what I tried: ...
0
votes
0answers
42 views

Unix -untar files only looping one time - C-shell

I have list of *.tar.gz files that I want to unzip and untar at once. The code: foreach summ (`ls *.tar.gz`) gunzip -d < $summ | tar xf - end But only one file has been untarred. How would ...
1
vote
2answers
60 views

Merging two files using scripts

I am trying to merge two files of different lengths using a script. I want the longer file to be appended to the end of the shorter file and when both files are of equal length they are suppose to ...
0
votes
0answers
32 views

Escape special chars in csh alias

I want to create an alias for the following thing: diff -r <dir1> <dir2>| grep diff | grep -v "Files " | grep -v "\.git" \ | awk '{print "tkdiff " $3 " " $4}' I am getting lost with ...
0
votes
0answers
40 views

Help me with C-shell Script: Disk checking

i am new in shell script. i have given a task to make a C-shell script. I have list of ip address and device name respectively. For example; cal 1 : 100.21.25.10 cal 2 : 100.21.25.11 cal 3 : 100.21....
1
vote
1answer
55 views

Alias gedit to accept an argument

This alias works in UNIX and in Redhat. It does not work in Fedora alias te 'gedit "\!*" &' Usage: te myfile.cpp It opens gedit with myfile.cpp in the edit window and runs in the ...
0
votes
0answers
87 views

why are directories which are empty not removed after rmdir?

foreach file (`find . | awk -F/ 'NF == 3'`) echo $file set olddir = `echo $file| cut -f 1-3 -d '/'` echo $olddir set newdir = `echo $olddir | cut -c 1-2,5-` echo $newdir mkdir -p $newdir ...
1
vote
3answers
137 views

csh: Using -d as an argument and not test

I know that -d /path/to/dir can be used to test command for checking a directory. Then: if ( $argv[1] == "-d" ) does not work because of that. However, I need to be able to pass -d as an argument ...
7
votes
3answers
113 views

'switch' based on shell

I would like to source (i.e. not call) a script from any shell (bash/csh are the primary targets, but fish, zsh, ksh, and rc would also be interesting). I would like if the script can be a single ...
1
vote
2answers
261 views

how to do inverse cut?

I am sill new in this. I would like to ask, how to inverse the cut? Example; ./24feb/frfr I want after cut command, the result will be ./feb/frfr. How to do it?
-1
votes
1answer
52 views

Avoid pgrep in csh

I got that code foreach pr (`pgrep "$NAME"`) And I try to avoid pgrep: foreach pr (`grep "$NAME" | awk '{$2}'`) but that does not really work. (later with that pr should be the PID printed out ...
0
votes
2answers
271 views

Bourne Shell to CShell

This works fine: #!/bin/sh ALTER="$1" NAME="$2" for pr in $(pgrep $NAME); do elapse=$(ps -o etime= -p $pr) [ "${elapse%:*}" -gt "$ALTER" ] && echo $pr done But if I try to switch ...
1
vote
0answers
174 views

csh: redirecting output from foreach

In csh: How do I redirect the output from a foreach-loop to a pipe? This works but uses a temp file: set tmpfile=/tmp/file ...
1
vote
2answers
124 views

List files in hierarchy of directory

I need to list files in hierarchy of directory. For that I wrote script like foreach file ( * ) ls ${file}/*/*/*/*/*.root > ${file}.txt end But for this I have to know that in the directory $...
0
votes
1answer
100 views

Is there a GUI debugger for csh script?

I have read another question in UNIX & LINUX stack exchange. The GUI provided in that question can be used to bebug *.sh file. How about to debug *.csh file? What other plugins for eclipse can I ...
2
votes
1answer
64 views

csh: Convert aliases into commands that set these

The command alias lists the active aliases. But it does this in a way that is different from how to set the alias: % alias foo 'bar \!*' % alias baz quux xyzzy % alias corge 'grault \ garply (quux ...
1
vote
1answer
965 views

How set environment variable permanently in Red Hat Linux?

As I'm using Red Hat Linux 5.3, I'm unable to set environment variable permanently. I want the file names for csh, from which I can add the environment variables permanently.
1
vote
1answer
64 views

csh array/command substitution with gnu parallel

First of all, yes, locked into csh on a Solaris box, can't do anything about it, sorry. I have a report batch I was running using a foreach loop. Right now it runs as a single thread and I would like ...
0
votes
1answer
159 views

C Shell Argument If Else Loop

I am new to C -Shell programming. I am writing a script that, if one or more arguments are entered after the script, it will display them. if no arguments are entered, it will say "Please enter one or ...
1
vote
0answers
75 views

csh: How to save the shell environment (env, current dir, shell history) in a file and set it on another shell?

I start interactive terminal using farm (LSF). These terminals get opened on some random host and get closed automatically after 15 days. I want to save the current shell environment (env, current ...
2
votes
2answers
108 views

Add an application to the command search path in csh

Recently, I have installed an application (gnuplot) under user directory (/home/usr/bin). I want to run the application whenever I type 'gnuplot' in any directory. What could I do? I tried to set the ...
2
votes
1answer
302 views

csh: setting command completion for `cd` to show both directories and files

In my csh terminal, when I do: ls tab -- it shows everything in the current directory as a possibility cd tab -- it shows only directories in the current directory as a possibility. If no ...