Yeah, I'm an idiot

Ovid on 2007-07-10T11:42:00

The joys of trying to fix a tiny problem, trying to do it quickly and not having enough coffee.

$ mkdir conf/devel
$ cp -R conf/* conf/devel

Hey, why is that taking so long?

Sigh.


yeah, why?

depesz on 2007-07-10T12:23:45

=> mkdir conf; mkdir conf/devel; touch conf/a

=> find conf conf conf/devel conf/a

=> cp -R conf/* conf/devel/ cp: cannot copy a directory, `conf/devel', into itself, `conf/devel/devel'

=> find conf conf conf/devel conf/devel/a conf/devel/devel conf/devel/devel/a conf/a

one level too deep, but it stopped quickly.

standard bash from ubuntu. => bash --version GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc.

Re:yeah, why?

depesz on 2007-07-10T12:25:41

eh. it was supposed to be better formatted.

=> mkdir conf; mkdir conf/devel; touch conf/a

=> find conf
conf
conf/devel
conf/a

=> cp -R conf/* conf/devel/
cp: cannot copy a directory, `conf/devel', into itself, `conf/devel/devel'

=> find conf
conf
conf/devel
conf/devel/a
conf/devel/devel
conf/devel/devel/a
conf/a

one level too deep, but it stopped quickly. standard bash from ubuntu.

=> bash --version
GNU bash, version 3.2.13(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

Re:yeah, why?

Ovid on 2007-07-10T13:27:09

$ uname -a
FreeBSD ************** 6.2-STABLE FreeBSD 6.2-STABLE #2: Thu Mar 29 20:01:22 BST 2007
root@**************:**************  i386

Re:yeah, why?

Ovid on 2007-07-10T13:33:10

Oh, and my bash:

$ bash --version
GNU bash, version 3.00.16(1)-release (i386-portbld-freebsd5.4)
Copyright (C) 2004 Free Software Foundation, Inc.

zzzz

jsn13 on 2007-07-10T13:48:32

yeah, that's why i always do something like

mkdir conf/zzzz
cp -R conf/*
mv conf/zzzz conf/devel

Easily fixed

Aristotle on 2007-07-10T19:48:11

shopt -s extglob
cp -R conf/!(devel) conf/devel

Not the same mistake, but related

bart on 2007-07-10T21:07:34

grep PATTERN *.txt >grepped.txt

Re:Not the same mistake, but related

vek on 2007-07-10T21:57:20

Ha. Now I've done that before ;-)