我在BASH脚本中有以下命令。如何检查命令是否已完成上传文件?
$(mysql -h "${1}" --user="${2}" --password="${3}" -D"${4}" --skip-column-names --local-infile=1 -e "LOAD DATA LOCAL INFILE '$tempFile' INTO TABLE $tableName FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' " )
答案 0 :(得分:0)
您可以执行查询,然后通过查看$?
:
mysql -h "${1}" --user="${2}" --password="${3}" -D"${4}" --skip-column-names --local-infile=1 -e "LOAD DATA LOCAL INFILE '$tempFile' INTO TABLE $tableName FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' "
if [ $? ... ]; then do_something