If $something_that_does_not_exist expands to zero (but I'm not sure if this is your problem?), Then the first mv will fail. The second mv command will also fail if "files*" does not expand to two files, or if the last file name "files*" extends to what will be a directory. Then the files will be moved to this directory.
If the command is in a script and you want your script to interrupt when you try to expand this variable and not be set, you can use the question mark modifier. Example:
$ echo ${DISPLAY?}; echo display :0.0 display $ echo ${MYTEST?}; echo mytest bash: MYTEST: parameter null or not set $
So if you use
mv folder ${something_that_does_not_exist?}
and something_that_does_not_exist not set, subsequent commands will not be executed.
source share