Questions tagged [csh]

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.

35 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
1answer
696 views

parametric aliases in csh to add export command

I'm trying to find a way to translate functions to csh/tcsh aliases, since they lack functions but have parametric aliases. As a first step I'm trying to create an export command. Here's what I've ...
3
votes
1answer
45 views

How to use here document or assign multiline string to variable in csh?

I want to assign to variable to a multi-line string that contains a variable and then echo it. I attempted using here-doc as shown below. What is the best way to achieve this in csh? set my_name="...
2
votes
0answers
131 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
0answers
73 views

Linking issues with leptonica and libpng

Working through an install of tesseract without sudo permissions and without a standard bevy of prebuilt libraries. The installation I've got to go through as far as I know follows the path of zlib -> ...
1
vote
0answers
48 views

Why my VM is adding backslash on every backslash in recent command

My company setups a new VM for me to work and I'm not really sure the configuration details of this VM. One interesting thing which is new to me is that I get an annoying backslash on every backslash ...
1
vote
2answers
241 views

Why does “ps -p proc1 proc2 proc3” show “-csh”, “-tcsh”, and “-/bin/tcsh”, whereas “ps -p proc[n]” individually all say “tcsh”?

I use tcsh (not csh), and ran pgrep csh | xargs ps -p to see why I appeared to be running csh. A portion of the results: 1529 pts/0 Ss 0:00 -csh 1764 pts/3 Ss 0:00 -tcsh 1979 pts/4 ...
1
vote
0answers
462 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
2answers
230 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 there ...
1
vote
0answers
204 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
1answer
513 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
0answers
927 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
0answers
141 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 ...
1
vote
0answers
95 views

How to install iwidgets without root access and set the enviornment

Recently, I want to run a script (PWgui) which requires Tcl (Itk). The manual suggests that I have to install iwidgets4 beforehand. I am using the university cluster and don't have any root privileges....
1
vote
2answers
988 views

CSH and all output (with errors) to file

I need save all output from compilation to file. I have many errors "undefined reference" and I want see all of these errors. I try "makeall >& out", but in file "out" aren't any of error "...
1
vote
2answers
110 views

C Shell: different actions depending on the file type

I very new to C Shell. I am trying to read a file from the command line, and determine whether it's a zip file, a .txt, a symbloic link, a pipe, or whatever ("unknown"). Then I'd like to execute a ...
1
vote
0answers
532 views

Verbose output in logfile and simple output on screen?

Let's say I have the following script: script.sh and i want the verbose output in a logfile and simple output on screen. Logfile should contain the csh -v script.sh output, and on the screen should ...
1
vote
0answers
186 views

alias Not able to execute source command

I am trying to define a following alias in my .aliases file. alias sett 'cleartool setview viewXYZ_!*; cd /path_dir1/dir2/; source ./env/script-name' I use it as sett myview on commnd prompt when I ...
1
vote
1answer
628 views

How do I start smbclient from a script in Linux?

I want to be able to quickly start smbclient to a specific directory without typing or copying it to the shell command line, but just sticking it in a script doesn't seem to work... #!/bin/csh ...
0
votes
1answer
29 views

csh: Changing path in non-interactive login

I want this: $ ssh nopathcsh@lo 'echo $path' /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games To return this: /usr/bin /bin I have tried changing and ...
0
votes
0answers
35 views

Add trailing slash in csh

How do I get csh to add a trailing slash at the end of tab autocompletion? eg: \stuff \otherstuff now if I type cd s and press tab, I get: \stuff and not \stuff\
0
votes
0answers
51 views

How to execute unix command after few background jobs?

My c-shell code has to complete few concurrent background jobs before execution of some unix commands. However, somehow in code my background jobs never returns handle to unix commands. i.e. $cmd1 | ...
0
votes
0answers
70 views

cshell text editor

Is there any text editor with highighting for cshell scripts that includes code folding? (Preferable something with a less steep learning curve than vim and emacs) I haven't been able to find ...
0
votes
1answer
228 views

Assigning / evaluating concatenated variables in tcsh

I have a tcsh puzzle, and would appreciate any help. When I run: set faceAttenRuns = (09 13) set run = $faceAttenRuns[1] echo $run This returns: echo 09. Great. But when I run: set runTypes =...
0
votes
1answer
1k views

How to execute an alias, encapsulated in another source file?

For instance ~/.cshrc: alias job_start 'cd $PROJ_DIR && source .env/bin/activate.csh && rehash && job_run' $PROJ_DIR/.env/bin/activate.csh: alias job_run '(cd $PROJ_DIR/...
0
votes
1answer
813 views

Having problems changing umask in csh

So i'm running RHEL 6.5 and I have a user that wants to use csh for what they are doing. They also want the umask to be set to 002. So I started to put umask 002 into .cshrc and call it a day. ...
0
votes
1answer
621 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 ...
0
votes
1answer
542 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
18 views

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

In this command (C shell script) make ${m} ARCH=${ARCH} >&! Make_${m} what does >&! mean?
0
votes
0answers
1k 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 ...
0
votes
0answers
156 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 ...
0
votes
1answer
725 views

csh: Terminal inherits environment variables from an unknown location

I'm on a shared machine running CentOS 5.10 that I log onto using VNC from Windows 7. Our default and official shell is csh. Every time I open a new terminal, I have three particular environment ...
0
votes
1answer
1k views

read each line one at a time in csh

In bash, code like this will read each line in a file one at a time: while IFS=$'\r' read -r line || [[ -n "$line" ]]; do something done < "to-read-file" When the code is running, as long as ...
0
votes
2answers
70 views

Comparing 2 files using awk , not getting any results - C shell

I am using c shell and trying to compare 2 files using awk . But the below awk statement doesnt give any result. Need to acheive this solution in awk using C shell. awk 'FNR==NR{a[$0]++;next} { {...
-1
votes
1answer
113 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 ...
-1
votes
1answer
146 views

csh: Get rid of job+PID when forking

With bash I can run: $ ssh bashuser@localhost '( ls -d / nosuchfile ) & echo foo; wait' foo ls: cannot access nosuchfile: No such file or directory / If I try the same with csh I get: $ ssh ...