This is a discussion on Solaris 7 MV command broken within the comp.unix.solaris forums, part of the Solaris Operating System category; --> I tried a simple mv command with the only peculiarity that the line was continued by a backslash, because ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I tried a simple mv command with the only peculiarity that the line was continued by a backslash, because the paths were a bit lengthy. I had similar commands in two different scripts. The first of them produced an error I did not understand, so a repeated it manually via copy/paste and then it worked. In the second script, the target directory was just DELETED! mv /A \ /B deleted B and all subdirectories and files therein!!! I have had similar cases in the past (always using continued lines), but every time, I thought it was somehow my mistake. No it wasn't. The mv command is broken. Beware of continued lines. Bye Rick Denoire |
| ||||
| Rick Denoire <100.17706@germanynet.de> writes: >I tried a simple mv command with the only peculiarity that the line >was continued by a backslash, because the paths were a bit lengthy. >I had similar commands in two different scripts. The first of them >produced an error I did not understand, so a repeated it manually via >copy/paste and then it worked. >In the second script, the target directory was just DELETED! >mv /A \ > /B >deleted B and all subdirectories and files therein!!! >I have had similar cases in the past (always using continued lines), >but every time, I thought it was somehow my mistake. No it wasn't. >The mv command is broken. Beware of continued lines. The "mv" command is blisfully unaware of continued lines; the shell sorts all that out. So something else would appear to have happened, though it's not immediately clear what would cause mv to delete a directory recursively. (The target will generally be removed unless it's a directory) Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth. |