我的脚本中有以下命令:
message="Secure copying file $remoteHost"
backupLogOutput "Info $message"
$(scp "$file" "$remoteUser"@"$remoteHost":"$remotePath") >> "$BACKUPLOG"
backupErrorHandler "$?" "$message"ShellCheck给我在scp行(3)上的警告:
删除周围的$()以避免执行输出。SC2091
剧本行得通。我确实想执行输出。我应该忽略这个警告,还是应该用不同的方式来写scp行?
发布于 2017-12-06 15:20:08
我不认为您实际上希望执行scp输出-它更像是您只是想复制一个文件:
scp "$file" "$remoteUser"@"$remoteHost":"$remotePath" >> "$BACKUPLOG"https://stackoverflow.com/questions/47677612
复制相似问题