Bash mv not a directory

主宰稳场 提交于 2019-12-06 08:46:56

Most likely, you just need:

mv temp_output* "$code"

This will move the files named temp_output* in the current directory to the directory specified in the variable $code.

However, if $code is a file, then you need to look for a rename command (there are several versions, with different syntaxes), or you need to use an inner loop:

for file in temp_output*
do mv "$file" "$code$file"
done

You are trying to move multiple files to a name that is not a directory, which is not possible. This happens because you seem to be trying to rename from a wildcard pattern to a wildcard pattern, which is also not possible. I won't be guessing what exactly you're trying to accomplish, so I cannot give you any additional advice.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!