You are on page 1of 71

| 

 
R

  R



  bash

 

R  

 
  
  

 
  

 
  

 |



|| ! 
  

R 

  

"#  
$




xbinxsh

xbinxbash
u
R %

m 



&xbinx shè


&xbinx shè

ÿ
&xbinxshè
R ' ( 

&xbinx shè


&xbinx shè

ÿ
&xbinxshè
R ' ( 

xbin, xsrxbin, xsrx axbin

xsbin, xsrxsbin, xsrx axsbin

x

x

xh xbrwi h
  


R) * 

 
 

!)  
  


  a > h  sh <<MY_PROGRAM


#!xbinxsh
h µH , wr
MY_PROGRAM
  h +x h  sh
  xh  sh
H , wr
  
R) * 

    
 
#!xbinxsh
h µH , wr

  h +x h  sh
  xh  sh
H , wr
R '
 

a > xxi

a >> xxi

a 2> xx rr p  

a < xxin 

a <<INPUT
S in     

INPUT

a > xxx 2>&1


  
+#

  a > h  sh <<MY_PROGRAM


 

h µH , wr
MY_PROGRAM
  h +x h  sh
  xh  sh
H , wr
  
 ,

  a > h  sh <<MY_PROGRAM


#!xbinxsh
  
MY_PROGRAM
  h +x h  sh
  xh  sh
H , wr
  
!)  

  a > h  sh <<MY_PROGRAM


#!xbinxsh
h µH , wr
MY_PROGRAM
    

  xh  sh
H , wr
  
 

  a > h  sh <<MY_PROGRAM


#!xbinxsh
h µH , wr
MY_PROGRAM
  h +x h  sh
  

 
*   

'R+

  xh  sh

h º-xsrxbinx h

  h $PATH
xbin:xsrxbin:xsrx axbin:
xh xbrwi hxbin

  whi h h
xsrxbinx h
U
 !º


  h  sh
bash: h  sh: Can n
n
  PATH=³$PATH: 
  h  sh
H , wr
R '. 
  h µ$USER
$USER
  h ³$USER
brwi h
  h ³\

  h ³ a n \\s 
 a n \s 
  h µ\
\
U
 !º

  n


ariab s ass   sb-rras
  NEW_VAR=³Y s
  h $NEW_VAR
Y s
  n

PATH b n NEW_VAR


  xr NEW_VAR
  n

PATH an NEW_VAR


  

+# /


an
an bash
an a
an an

an ±
an ± ana

]  
   D0 !-

u"
 %


h:xxwww  rxPxabsxhx



  bash
  / '1
  h This \
Is \
A \
V r \
n \
Can in
This Is A V r n Can in
 
!)   

$?

 


  s x sxnx xis


  h $?
1
  h $?
0
!)   ' xi

  a >  s sh <<_TEST_
xi 3
_TEST_
  h +x  s sh
  x s sh
  h $?
3
/ ' 

   s 1 - 10
  h $?
0
   s 1 == 10
  h $?
1
/ ' 

 s

 
 1 ± 10 

 
 ³his srin =~ ³his 

 ))
 1 < 10 ))
/ ' 

 - x  xassw 

 ! ± x  xassw 

 - x  xassw ±a ± x  xshaw 

 - x  xassw ± ± x  xshaw 
R '$ )) "
2 

  h $ 1 + 2 ))
3
  h $ 2 * 3 ))
6
  h $ 1 x 3 ))
0
/ ' "
i á 
h n
:
# ³ i a nra in  ³ s i:
i á  á
h n
:
s
h n
:
i
/ ' "
i  $USER ±  ³brwi h 
h n
:
# ³ i a nra in  ³ s i:
i s x  xraab
h n
:
s
h n
:
i
/ ' "

# s i a i xiss
i  - x  xassw 
h n
h ³x  xassw xiss
s
h ³x  xassw n n!
i
/ '"

r i in 1 2 3

h $i
n
/ '"

r i in x*

h ³isin $i:
s - $i
r a
n
/ '"

r i in x*

h ³isin $i:
s - $i
r a
n
/ '"

r i in x*

h ³isin $i:
s - $i
r a
n
/ ' ("

r  xr1 ;
xr2 ;
xr3 ))

is
n
/ ' ("

IMIT=10
r  a=1 ;
a<=IMIT ;
a++ ))

h ±n ³$a 
n
/ '# 

whi á 

:

n
/ '# 

a=0; IMIT=10
whi  "$a" - "$IMIT" 

h -n "$a 
a=$ a + 1 ))
n
 


COUNTER=0
whi  - ³$FIE COUNTER 

COUNTER=$ COUNTER + 1))
n

 '
   
 'u
%
  a > xahxxxasswrs <<_PW_
FTP_USER=³s 
_PW_
  h $FTP_USER

  xahxxxasswrs
  h $FTP_USER
s 
 
U
2  
  FIEPATH=xahxxx is
  h $FIEPATH
xahxxx is
  h ${FIEPATH  is}
xahxxx
  h ${FIEPATH#*x}
ahxxx is
  h ${FIEPATH##*x}
 is
p

  
 

   

 


"
 



 3 

$?

A 4  
OUTPUT=` h ³H `
OUTPUT=$ h ³H )

   #


 '<D>
 
 
p  

/ "/ 



    
h ³H  | \
w -
 

p  

    
!   "  

  h ³M ssa  | \
ai ±s ³H r s r  ssa  \
brwi h@w 
, 

  ATESTRING=`a + Y  `
  h $ATESTRING
20060125
  an a
* +
(

 ±n ± s r
r w  <<_FTP_
s r ˜á
  áá

 FIE
_FTP_
*# w 

w  \
:xxs r:ass@s r
r w xi

w  ±r \
:xxs r:ass@s r
r w xirx
*#  r

r ±T a-i \
- s rna :asswr \
:xxs r
r w xirxi

 'r 

  r  rara x  xassw
  r  ±r rara x 
  r  ±r RAYRA x 
  r  ±ri RAYRA x 
  r  ±ri rara x 

 'in

5in xh xbrwi h \


-na µ* is
±  á    á
  in xh xbrwi h \
-i -1 ±na µ* is
± á     
  an in

 ' a

   a is
± á   á  
   a 
± á á 
 áá á
R  

 
236
/ "! 

R   


7

hisr

 -

 (| ! 

  
   x
  sh x
arx
x
arx x
  
  w
x
ar
  
x
2 

 

s

s ± 

s ± ra 

s ±C ssh

an s
u, %2* 

#!xsrxbinxbash^M

*
"
 RD

s2nix ini > i


ss
JOB=³ZZZTEST
PARAMS=³ZZZTEST_PARAMS
PARAMS_USER=³BORWICJH
ss $BANNER_USERx$BANNER_PW << _EOF_
s  s r
r n
s  sr ""

EXECUTE WF_SATURN FZ_G _Para  rs$JOB,


$PARAMS, $PARAMS_USER);
_EOF_
ss
ss $USERx$PASS @$FIE_SQ \
$ARG1 $ARG2 $ARG3
i  $? ±n 0 
h n
xi 1
i
i  - xi xsxshx r a 
h n
± ˜á 
    
i

R3R(/(
 R
 

  a >  s sh <<_TEST_
h ³Yr na is \$1 \$2
_TEST_
  h +x  s sh
  x s sh Jhn Brwi  inr -
his
Yr na is Jhn Brwi 
 4    
$1'
,
$2' #

$3' 

$4'
 
$5'
 


  xahxxrxs ri $UI $PW \


$ONE_UP $JOB $PRNT
  4

  rnab -
0 0 * * * ai-inih- b sh
0 * * * * hr- b sh
* * * * *
r-in sh
0 1 * * 0 1AM-n-sna sh
  EITOR=
i rnab ±
  an 5 rnab

. 




bash

 

bash