![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| what is gcc -e option in C | useless79 | High Level Programming | 3 | 12-05-2007 01:36 PM |
| su option | lesstjm | UNIX for Advanced & Expert Users | 1 | 11-02-2005 01:54 PM |
| -h option | Raom | UNIX for Advanced & Expert Users | 1 | 10-26-2005 02:19 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
OS: AIX 5.3
Let me restate my problem again. i want to copy dirone to dirtwo, they're similiar, but there are some extra files in dirone that dirtwo doesn't have, going through them one by one takes way too long. So I use the following command to copy one directory to the second. cp -R -h -i /dirone/* /dirtwo I wanted -i in there because I do NOT want to overwrite, the directory is huge and i had to sit here pressing enter for 1.5 hours. Now my question is, is there an option that is "no to all"? Thanks, any help is much appreciated. |
|
||||
|
Hi ,
I would instead use a simple script like the one below to achieve same. Hope this helps. #! /bin/ksh export SRC_DIR=/YOUR/SOURCE/DIRECTORY export TGT_DIR=/YOUR/TARGET/DIRECTORY for i in `ls $SRC_DIR` do echo $i if [ -f $TGT_DIR/$i ] then echo " File exists - will not overwrite it !!!" else echo " File $i is not present on target directory - copying same" cp $SRC_DIR/$i $TGT_DIR/$i fi done |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|