Unix Technical Forum

Solaris 7 MV command broken

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > comp.unix.solaris

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-06-2008, 07:46 AM
Rick Denoire
 
Posts: n/a
Default Solaris 7 MV command broken

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-06-2008, 07:48 AM
Casper H.S. Dik
 
Posts: n/a
Default Re: Solaris 7 MV command broken

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:11 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com