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

check T dated files and then check if any thing is there in that file

consider todays date as 24/02/14 I have set of files in mention directory "/apps_kplus/KplusOpenReport/crs_scripts/rconvysya" and file names…
user3164140
  • 591
  • 2
  • 8
  • 15
0
votes
1 answer

Arithmetic operation on time variable in c-shell

I need help using time in the c-shell I want to know how much time it took to execute a script,so i want to do in the following way 1.set start_time=time 2 script part 3.set end_time=time 4. set diff=end_time-start_time 5.echo "It took…
Vinod kumar
  • 67
  • 1
  • 11
0
votes
4 answers

How to get count of file with T date as part of file name

consider todays date as 24/02/14 I have set of files in mention directory "/apps_kplus/KplusOpenReport/crs_scripts/rconvysya" and file names…
user3164140
  • 591
  • 2
  • 8
  • 15
0
votes
2 answers

run command as other user in unix shell script csh

Assume I am user A(not root user) and I want to run a c-shell script which will execute command in User B(password for B is known to me) and will use the result of that command here. How can I run a command in User-B. sudo -u username…
pankaj_ar
  • 757
  • 2
  • 10
  • 33
0
votes
1 answer

How to setenv as PWD?

I'm trying to set my JAVA_HOME using : setenv JAVA_HOME 'pwd' , however , it sets it as pwd , rather than the actual path we get using pwd . I know it might be a stupid question but I'm an absolute newbie to Linux. Using CSH. Is there any way to do…
h4ck3d
  • 6,134
  • 15
  • 51
  • 74
0
votes
3 answers

Rename all subdirectories in csh shell

I'm using csh and I have a directory structure containing multiple sub-directories. I'm trying to rename all the directories and sub-directories but not the files inside these directories. So something…
0
votes
1 answer

Adapt bash loop to be use in csh

I am trying to adapt the loop code from bash to csh: while read file; do if ! UPLOAD_FILE=$(ls "$UPLOAD_ARCHIVE_DIR"/*$file* 2>/dev/null); then echo "could not find $file" (( MISSING_COUNTER++ )) continue fi ls -l…
sayayinx
  • 21
  • 4
0
votes
1 answer

Running the same shell script in multiple directories at once on Unix

I have 35 distinct directories, named case1 to case35 respectively. I have the same shell script in each of them and I was wondering if there is a way to execute it in every directory at once.
JXS832
  • 37
  • 1
  • 8
0
votes
1 answer

csh environment variable execute

I'm building a command line up in a tcsh shell variable, something like set cmd = "/usr/local/bin/rsync " set parm = "--verbose --acls --times --links " set src = "/spindle/to\ be\ backed-up " set dest = "/mnt/backup21 " set final = "$cmd $parm…
0
votes
1 answer

Find and Replace one list of "words" with another list of "words" pairwise in csh

I am trying to modify some length code. I want to replace words in all words in list 1 with words in list 2 (pairwise). List 1: Vsap1*(GF/(Kagf+GF)) kdap1*AP1 vsprb kpc1*pRB*E2F . . List 2: v1 v2 v3 v4 . . In other words, I'd like it to replace…
0
votes
1 answer

how to eval csh shell variable

#!/bin/csh set passFail_file = "name" set numErrs = `/bin/grep -c ERROR $passFail_file` echo "numErrs is $numErrs" # displays numErrs is 0, which isn't always correct set dirLocale = `/bin/sed q $passFail_file` #capture line 1 in file,…
frododot
  • 127
  • 2
  • 16
0
votes
2 answers

Calculating number of days given date in UNIX

I have tried to calculate number of days from January 1st to given date in same year. Option -d for UNIX command isn't working date -d date: illegal option -- d Usage: date [-u] [+format] date [-u] [mmddhhmm[[cc]yy]] date [-a…
Cikson
  • 106
  • 2
  • 17
0
votes
1 answer

How can I kill all child processes when exiting from my shell script?

I've got a C shell script that runs a program. That program spawns off a child. When I send a SIGINT to my shell script via ctrl-C, the shell script exits as well as the process that it spawned I think. However, the last process remains. How can I…
dromodel
  • 9,581
  • 12
  • 47
  • 65
0
votes
1 answer

How can I run a command in a remote xterm?

In a cshell script, I spin-out an xterm. From the shell where the script is executed from, I wish to execute a command (eg: banner master win) in the xterm that has been spun out from the script. Can you suggest me a way to do that? Do you think…
0
votes
1 answer

linux find exec positional parameter

I'm currently using the following line to find a number of scripts and execute them. The scripts are named as : my_script_0.sh, my_script_1.sh, etc. find $MY_HOME/SHELL/my_script_[0-9].sh -type f -exec csh -c '"$1" >& "$logfile" &' {} \; This…
McArthey
  • 1,614
  • 30
  • 62