脚本如下: #!/bin/bash mysql -s -phello test >.log <<EOF desc t1; EOF lines="concat_ws(','," count=`.log|wc -l` linenum= while read line do coloumname=`echo $line |awk '{print $1}'` let linenum=linenum+ ];then lines=$lines"concat_ws(':'…
脚本如下: #!/bin/bash for i in 'seq 1 9' do for j in 'seq 1 $i' do k=$[$i*$j] echo -ne "$j""X""$i=$k\t" done echo done 执行脚本: sh cheng1.sh 上面代码执行会报错: cheng1.sh: line 6: seq 1 9*seq 1 $i: syntax error in expression (error token is…
重要使用的是EOF的功能,亲测和!功能一致:下面是测试代码 #!/bin/bash val=`ls`for v in ${val} do if [ ${v} == "test.db" ] then rm test.db echo "rm test.db" fidone sqlite test.db << EOFcreate table test(name char,sex char);insert into test values("yang&…