Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
If and Case
Name: smart2 (by patelh) Date: April 10, 2007 at 12:09:32 Pacific OS: Windows XP CPU/Ram: 1024MB Product: Sony Vaio
Comment:
Can someone briefly explain to me what is occurring in this script?
#!/bin/csh if ($#argv < 2) then echo Not enough arguments echo usage: chx *.oldx nwx exit 0 endif mkdir /tmp/chx.$user set nwx="$argv[$#argv]" set oldx="$argv[1]:e" echo "are you sure you want to run chx?" switch ($<) case y: breaksw case yes: breaksw default: echo Nothing done exit 0 endsw set i=0 foreach file ( $argv ) @ i++ if ( $i == $#argv ) break cp $file /tmp/chx.$user/$file:r end set array = `ls /tmp/chx.$user` foreach file ( $array ) if ( -f $file.$nwx ) then echo destination file $file.$nwx exists. No action taken continue endif cp /tmp/chx.$user/$file $file.$nwx rm $file.$oldx end rm -r /tmp/chx.$user
Summary: Can someone show me the exact syntax for an IF AND statement using ksh? I thought it would be like the following, but it doesn't seem to work: if [ $VAR1 -ne $VAR2 and $VAR1 -ne $VAR3 ] then ...(do s...
Summary: A) Context Free Grammar for if……..else………if statement ---ŕ if ( ) else if ( ) = Statement = Expression Non-terminal symbols are and Terminal symbols are if and else is the S...
Summary: i have been hearing about SCO and IBM issue over AIX UNIX. I need to inquire if the case is solved and what is the conclusion or the end result of the issue. If anybody can lead me to some useful link...