当前位置:编程学习 > 网站相关 >>

Shell 遍历字符串与参数

遍历字符串:

for line in  $Table_List
do
        echo $Table_List
        echo $Table_List >> ${SYB_LOG}/log.txt
        echo "TRUNCATE TABLE $Table_List" > ${SQLFILE}
        echo "go" >> ${SQLFILE}
        $SYBASE/OCS-15_0/bin/isql -I/opt/muni/HNWEnv/HNW_inte易做图ces.txt -U${SQL_USER} -P${SQL_PASSWD} -S${SQL_GOLDEN} < ${SQLFILE} >${TMPFILE}
done


遍历参数:

for line in $*
do
        echo "TRUNCATE TABLE $line" > ${SQLFILE}
        echo "go" >> ${SQLFILE}
        $SYBASE/OCS-15_0/bin/isql -I/opt/muni/HNWEnv/HNW_inte易做图ces.txt -U${SQL_USER} -P${SQL_PASSWD} -S${SQL_GOLDEN} < ${SQLFILE} >${TMPFILE}
done

exit 0;


 

补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,