如何为“编写shell脚本”;AWS S3 Cp“;等待完成
我有一个shell脚本,它将从S3文件夹下载文件,下载完成后,我想执行某些其他操作 如何编写等待下载完成并执行脚本其余部分的shell脚本 S3SourcePath=$1 Targetlocation=$2 清除目标位置文件 rm-frd$Targetlocation/* 将文件从S3下载到本地 aws s3 cp$S3SourcePath$Targetlocation—递归 cd$Targetlocation printf'%s\n'$PWD/*>upload.csv如何为“编写shell脚本”;AWS S3 Cp“;等待完成,shell,amazon-web-services,amazon-s3,cp,Shell,Amazon Web Services,Amazon S3,Cp,我有一个shell脚本,它将从S3文件夹下载文件,下载完成后,我想执行某些其他操作 如何编写等待下载完成并执行脚本其余部分的shell脚本 S3SourcePath=$1 Targetlocation=$2 清除目标位置文件 rm-frd$Targetlocation/* 将文件从S3下载到本地 aws s3 cp$S3SourcePath$Targetlocation—递归 cd$Targetlocation printf'%s\n'$PWD/*>upload.csv printf“%s\n”
printf“%s\n”1 i“文件或文件夹路径”。你试过什么了吗?是什么让您相信shell脚本会在
aws s3 cp
命令完成之前继续执行其他语句?@mark b基本上我想在.csv文件中添加下载文件的完整位置,然后我将使用该文件上载到box,我的代码如下`S3SourcePath=$1 Targetlocation=$2#清除目标位置文件rm-frd$Targetlocation/*#将文件从S3下载到本地aws S3 cp$S3SourcePath$Targetlocation--recursive cd$Targetlocation printf'%s\n'$PWD/*>upload.csv printf”%s\n“1 i”File\u或\u Folder\u Path“。w | ed upload.csv`--有时这个upload.csv会下载所有文件,但有时什么都不可用。由于逻辑原因,似乎还有其他问题,我只是再次尝试,shell脚本正在等待aws s3 cp命令完成