The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
g++ and the -R option eternalflame High Level Programming 0 04-14-2008 02:57 PM
option followed by : taking next option if argument missing with getopts gurukottur Shell Programming and Scripting 2 03-17-2008 12:46 PM
-n option ravi raj kumar Shell Programming and Scripting 1 01-03-2008 09:20 AM
cc option kuldeep_bora High Level Programming 4 06-02-2006 10:38 AM
cut -f option 435 Gavea UNIX for Dummies Questions & Answers 1 11-10-2003 05:50 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-16-2009
Altay_H Altay_H is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 11
mv --no-clobber option

Hi,
I'm writing a script in which I need to move files from one directory to another. However, some of the files have the same name, and I want to keep the older file, so I can't use --update. I'm moving files from the newer directory to the older directory, so what I'm looking for is a way to automatically not overwrite. Basically, I need the behavior of mv with the opposite of --force option. I can't use the --interactive option either, because I'm copying multiple files and I don't want mv to hang.

There's no reason I must use mv, I just assumed it'd be the easiest way to accomplish what I need. If there's an easier way that doesn't involve mv I'm open for suggestions.

After searching around a while I found this recent webpage which makes it seem as though mv will now have a --no-clobber option which will do exactly what I need. I'm running Ubuntu on this computer, so I'm sure the webpage is relevant, but mv doesn't like --no-clobber despite the fact that my system is updated.

So basically what I need is explained in the first paragraph. I want a script to move files from one directory to another and automatically NOT overwrite: the oppsite of --force.

Thanks in advance for any help or suggestions!
 

Bookmarks

Tags
move, no-clobber

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0