ip=""
port="1521"
database="dwdb"
username="bi_zqdw"
password="Zqdw#2021"
set -x
for file in ~/etl_app/fa45/script/ld/boi/*.sh
do
if test -f $file;then
# arr=(${arr[*]} $file)
command="$file $ip $port $database $username $password"
# echo "$command"
sh $command
fi
done
shell跑数命令
于 2021-11-29 14:44:00 首次发布
此博客介绍如何使用for循环和if条件,通过set-x命令执行shell脚本,连接到数据库dwdb,使用bi_zqdw用户名和Zqdw#2021密码,针对~/etl_app/fa45/script/ld/boi目录下的.sh文件进行操作。
498

被折叠的 条评论
为什么被折叠?



