Tag:expr bsp Command not csharp other filename line awk
Shell Learning notemain= "/usr/local/" # Variable uppercase status= "$MAIN/status" # USD multibyte string is a reference variable value, while USD multibyte number indicates command line parameter echo "some words" > > $STATUS/log.logecho "test.sh start at ' date ' +%m/%d%h:%m:%s '" >> $STATUS/log.logcat $FILE | Grep-v "#" > $OTHERFILE. list#-V Culling # lines beginning with year= ' date +%y echo $LINE | Awk-f "+" ' {print $var} ' #-F with ' + ' as the delimiter if [-S ' ${path}/test.list ']# if the file exists is not 0 o'clock true if [-N ' $var 1 "-o-n" var2 "]#-n when the length of the string is large True at 0 o'clock (string non-empty)-a,-o,! Logic with, or, non-# ${ARGS1}_$ARGS2 plus {} is to make it clearer that args is a variable rather than a args_, and does not confuse variables when encountering multiple parameters thenfor line in ' Cat $file ' do# substr (s,p,n) Returns the suffix portion of the string s starting from p in length n exam:substr ($string, 0,length (1)) Result:sfilename = ' echo $LINE | Awk-f "+" ' {print substr ($1,0,1)} ' expr $value \* $timesif ["$flag"-eq "1"]thencheckflag= ' Checkschedule "${args1}" "$Arg S2 "' # Checkflag equals Checkschedule function return value, $Args 1 is the incoming parameter func" $var 1 "" $var 2 "#传入var1, 2 to function func () Fidonefifunc () {var1=$1var2=$ 2}
Shell Learning Note