LogIn E-mail
¼³°èÀ̾߱â
[csh]ARGV
# 1 JMJS    00.6.27 10:26

#!/bin/csh -f
# First Line of a Script
#                Execute C shell.
#!/bin/sh        Execute Bourne shell. (BSD only)        
#!/bin/csh -f        Fast C shell startup (BSD only)
unset echo

set afile        = ""
set aoption      = "off"

if ($#argv == 0) then
   goto help
endif

if($#argv < 2 || $#argv > 2) then
   echo "usage: $0 infile outfile"
   exit 1
endif

if(! -f $1) then
   echo "$0: $1: No such file or directory"
   exit 1
endif

while (( $#argv > 0 ) )
    set i = $1
    switch ($i)
      case -file:
          shift
          set afile =  $1
          breaksw
      case -option  :
          set aoptoin   = "on"
          breaksw
   endsw
   shift
end

if ($afile != "" ) then
  if ( ! -f $afile ) then
     echo "Error: cannot find drc deck '$afile'"
     exit 1
  else

@ i=1;
while($i<= $#file)
   echo $file[$i] >> $outfile
   @ i++
end

  endif
else
  echo "Error: please specify filename"
  goto help
endif

echo "Done..."
exit 0

help:
cat <<EOF
 usage: arg.csh [options]  -file filename
EOF

exit 0

°Ô½Ã¹°: 112 °Ç, ÇöÀç: 2 / 2 ÂÊ
¹øÈ£ Á¦       ¸ñ ÀÛ¼ºÀÚ µî·ÏÀÏ ¹æ¹®
12  [Tcl]Tool Command Language JMJS 09.7.24 2989
11  [csh]vi.csh JMJS 00.6.27 1602
10  [csh]Check Process JMJS 00.6.27 1534
9  [csh]Get Character and get char without 'return' JMJS 10.2.8 1664
8  [csh]foreach SED JMJS 00.6.27 1972
7  [Window]¿À·ùº¸°í ¾È ¶ß°ÔÇÏ´Â ¹æ¹ý JMJS 09.9.23 1543
6  [csh]echo.csh JMJS 00.6.27 1717
5  set DDD = `date '+%y%m'` JMJS 00.6.27 1454
4  [SH]Advanced Bash-Scripting Guide JMJS 09.4.24 1404
3  [csh]Beep : echo ^G;sleep 1 JMJS 00.6.27 1740
2  [csh]if ($abc == $bbc) then _ else _ endif JMJS 00.6.27 1936
1  [csh]ARGV JMJS 00.6.27 2008
[1] [2]