• Rob's side project: I recently started Gun-Forums.com and we currently have a $100 raffle - if you're into guns, join up and enter the raffle to win $100.00. Gun Forums

mv command exist with code 0, even if it falls..


New Member
I'm currently writing a script to rename a file (by using the mv command)

However, when the move fails, due to file already exist, the mv command exist with code 0

If I'm pressing ctrl-c, I will get exit code 130..

Is mv supposed to behave like this?
How why, I'm confused..
Isn't there anyway to get around this issue?
Must I first do a check if the file already exist?

Members online

Latest posts