Que^n, tra'nh tru+o+`ng ho+.p kho^ngcho options na`o, ba'c the^m va`o
sau
do`ng #!/bin/tcsh

if ( $# < 1 ) then
  cp
 exit 1
endif


> #!/bin/tcsh
> 
> set MYOPTION="-dir"
> 
> set n=$#argv
> set var=""
> set i=1
> while ( "$argv[1]" != "$MYOPTION" )
>   set var="$var $argv[1]"
>   shift argv
>   if ( $i == $n ) break
>   @ i++
> end
> 
> if ( $i == $n ) then
>   cp $var
>   exit 0
> endif
> 
> shift argv
> 
> foreach mydir ( $argv )
>   if ( ! -d $mydir ) continue
>   cp $var $mydir
> end
> 
> exit 0
> 
> 
>

-- 

Le^ Hoa`ng Nam
Kushiro [EMAIL PROTECTED]


[EMAIL PROTECTED]
[EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
VietLUG-users mailing list
VietLUG-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vietlug-users

Trả lời cho