[CLUE-Tech] The cp command

Kevin Cullis kevincu at orci.com
Sun Apr 22 16:02:47 MDT 2001


John,

Thanks for the tip.  As always, the synergy of UNIX tools surpasses the
normal CLI.

Kevin

John H Swaby wrote:
> 
> On Sat, 14 Apr 2001, Kevin Cullis wrote:
> > Brandon, Thanks for the script.  I'll try it out.
> >
> > Brandon N wrote:
> > > here is the script, i called it cpr  (copy recursively)
> > >
> > > #!/bin/bash
> > > for directory in `ls -d */`;
> > > do
> > >     cp $1 $directory
> > > done
> > >
> > > then just do
> > > cpr file
> 
> No need for a script.  This will work just fine:
> 
>   ls -d */ | sed 's/^/cp myfile /' | sh
> 
> To understand the above you need to be aware that, unlike most Unix
> utilities, ls is not always WYSIWYG.
> 
> ls [-d], on its own, will present its output in multiple columns.
> But piped or redirected, its output is a single column.
> 
> IMHO the CLI cannot be beat for flexibility and power.
> The GUI interface may be "easy"; but it is limited and weak.
> 
> John Swaby
> 
> -------------
> 
> There is no point in comparing vi and EMACS:  vi is just
> an editor; whereas, EMACS just happens to have an editor.
> 
>   E xtensible
>   M odifiable
>   A lgorithmic
>   C omputer
>   S ystem
> 
> _______________________________________________
> CLUE-Tech mailing list
> CLUE-Tech at clue.denver.co.us
> http://clue.denver.co.us/mailman/listinfo/clue-tech



More information about the clue-tech mailing list