Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi, jeevan_fimare.
In general, Bourne shell (sh, ksh, bash, etc) syntax cannot be used in csh. There are versions of csh, namely tcsh, that may be more lenient for some features, but basically the families are different. Here's an example showing syntax as well as the system variable status:
Producing:
I suggest you look over man csh as well as the tutorial at Csh , the section on setting variables, for example is Csh
The shell csh is considered by many to be not well-suited for scripting (on the other hand, tcsh is often chosen for interactive use) ... cheers, drl
I would like to know if indentation is relevant for Cshell scripts.
I wrote my code like this:
if ((-e file1) && (-e file2)) then
cat file1 > file10
cat file2 > file20
endifUsually I write my if clauses like this:
if ((-e file1) && (-e file2)) then
cat file1 > file10
... (1 Reply)
i have in c-shell
set value_str ="one three"
set line_seprator = ","
set value_and_sperator = "$value_str$line_seprator"
setenv STRING_CONCAT $STRING_CONCAT$value_and_sperator
and im getting error:
setenv: Too many arguments.
this is... (1 Reply)
Hi .I am trying to check the first arguments =-s and the third =-d,but it doesnt work ,any idea why
It gives me if: Missing file name
Thanks
#case -s and files
if( $1 == "-s" && $3 != "-d" ) then
echo "case s"
endif (1 Reply)
Hello everyone! i'm new in this forum and I'm here because I have a huge problem with a csh script. Here the problem: I have to write a script that check the system status, more precisely I have to check if there are processes with TIME > 3 hours and if such processes exists I must send a mail... (3 Replies)
If I want to compare two string variables in csh how do I correctly implement it. For example I'm checking if on cmdln the $1 == -r do something.
if($1 == -r) then
code....
However when I run it I just get an error message "if: Missing file name".
Any suggestions? (1 Reply)
Hi guys,
Basically I'm trying to write a CShell script that calls an awk script on a given directory (given in command-line). I keep getting a syntax error with my code though:
#!/bin/csh
set dir = $ARGV
foreach file ( $dir/* )
set output = 'awk -f /Desktop/aal $file'
echo... (3 Replies)
Hello...
I am new to unix and I am wondering if in a C-shell script , Are we supposed to use only whole numbers........ for example..if a program needs to calculate the average of some numbers........
@ avg = (($1 +$2 + $3)/3)) is returning a whole number.........How can a decimal be achieved... (1 Reply)
Hi
We use # sign to ignore any line (i.e. comment ). But is it possible to ignore group of line at once or i have to use # in front of each line.
Thanks
Sarbjit (3 Replies)