Building LFS/BLFS on USB.

Michael Shell list1 at michaelshell.org
Sat Apr 7 14:32:04 PDT 2007


On Sat, 7 Apr 2007 16:48:50 -0400
Michael Shell <list1 at michaelshell.org> wrote:

> cp -a --no-descend /mnt/* /mnt/backup
> 
> which would copy the contents of /mnt, but would not go down into
> the subdirectories of it, but would descend in every other
> directory. (i.e., selectively turn off -R)


Maybe that should read:

cp -a --no-descend /mnt / /mnt/backup

and maybe --not-file and --not-dir could be combined as --not:

cp -a --not /mnt / /mnt/backup

I should also mention to those using cp -a for backups
that you don't want to descend into /proc or /sys either.

So, I'd want a:

cp -a --no-descend {/mnt/backup,/proc,/sys} / /mnt/backup

which would even copy everything mounted in /mnt with
the exception of /mnt/backup - which would be circular.

> cp *.txt **.tex

This of course would be a "shell thing" rather than
a "cp thing".

Also, it seems that ksh has ! and tcsh has ^ (not)
operators:

http://www.linuxdevcenter.com/pub/a/linux/lpt/18_15.html

But, I don't know anything about them or if bash has something
like that. And then this gets into an whole other area of where
regex matching should be handled - the shell or the application.
It is nice to be able to apply the shell regex functions to every
application and it certainly keeps from having to reimplement
all that complexity within every application. However, there are
some cases where only the application itself can carry it out
properly because it has access to information that the shell does
not have.


  Mike



More information about the blfs-support mailing list