Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: UNIX command cp

Re: UNIX command cp

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Sun, 14 Jan 2001 21:10:06 +0100
Message-Id: <10741.126628@fatcity.com>


Jared,

  Worst still on a French keyboard, as . and ; are on the same key (respectively shifted and unshifted).
When you intend to type rm *.log and see :

  log: command not found

you can look for your backup ...

jkstill_at_teleport.com wrote:

> The only problem with wild card expansion I've ever experienced
> is of the idiot user variety ( me in this case :)
>
> e.g. rm *>txt
>
> when what I really meant was 'rm *.txt'
>
> That's what happens when your finger drags on the
> shift key a little too long.
>
> Jared
>
> On Fri, 12 Jan 2001, yong huang wrote:
>
> > I vaguely remember a long time ago somebody in a UNIX group says using wild
> > cards in the cp command is dangerous, because after * expansion, the second
> > file (the 2nd argument) gets overwritten by the first file (the 1st arg). Since
> > then, I've always used
> >
> > for i in *; do
> > cp $i $i.bak #or cp $i /somedir
> > done
> >
> > But I can't reproduce that danger. Can anyone give an example?
> >
> > What triggered me to ask this is an interesting incident. Recently I inherited
> > our production server and stayed late to test the cold backup script which I
> > modified a little bit. From ps -ef | grep cp, I saw the command:
> >
> > cp /myoradatapath/system01.dbf /myoradatapath/system02.dbf
> >
> > Sweats came to my forehead!!
> >
> > What happens is that the C shell script the former DBA wrote is simply doing:
> > cp /myoradatapath/* /anotherdir. But ps -ef only displays part of the expanded
> > command.
> >
> > Anyway, can anyone give an example to show that cp * *.bak or the like
> > overwrites files? Thanks.
> >
> > Yong Huang
> > yong321_at_yahoo.com
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: yong huang
> > INET: yong321_at_yahoo.com
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
Received on Sun Jan 14 2001 - 14:10:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US