Problem with bash script

2009-06-16 Thread Carmel NY
I am attempting to write a simple Bash script that will find all the '*.pem' files in a directory structure and move them to another directory. It seems to work until I get to the copy part where it fails. My scripting skills are not that good. Perhaps someone could tell me what I am doing wrong.

Re: Problem with bash script

2009-06-16 Thread Bertram Scharpf
Hi, Am Dienstag, 16. Jun 2009, 09:09:09 -0400 schrieb Carmel NY: [...] It seems to work until I get to the copy part where it fails. My scripting skills are not that good. Perhaps someone could tell me what I am doing wrong. # copy the file to another directory using the base name cp $i

Re: Problem with bash script

2009-06-16 Thread Moises Castellanos
Hi Carmel On Wed, Jun 17, 2009 at 8:39 AM, Carmel NY carmel...@hotmail.com wrote: I am attempting to write a simple Bash script that will find all the '*.pem' files in a directory structure and move them to another directory. It seems to work until I get to the copy part where it fails. My

Re: Problem with bash script

2009-06-16 Thread Daniel Underwood
$ find ./ -name *.pem -exec cp {} /usr/home/tmp/something \; I'm a novice with shell scripting myself, but what's the difference between that code and some variant thereof using a pipe and xargs? Are they simply two different ways of achieving the same result? Or is there some more important

Re: Problem with bash script

2009-06-16 Thread Carmel NY
On Tue, 16 Jun 2009 15:56:15 +0200 Bertram Scharpf li...@bertram-scharpf.de wrote: Hi, Am Dienstag, 16. Jun 2009, 09:09:09 -0400 schrieb Carmel NY: [...] It seems to work until I get to the copy part where it fails. My scripting skills are not that good. Perhaps someone could tell me

Re: Problem with bash script

2009-06-16 Thread Paul Schmehl
--On Tuesday, June 16, 2009 08:09:09 -0500 Carmel NY carmel...@hotmail.com wrote: I am attempting to write a simple Bash script that will find all the '*.pem' files in a directory structure and move them to another directory. It seems to work until I get to the copy part where it fails. My

Re: Problem with bash script

2009-06-16 Thread Daniel Bye
On Tue, Jun 16, 2009 at 02:33:37PM +, Paul Schmehl wrote: --On Tuesday, June 16, 2009 08:09:09 -0500 Carmel NY carmel...@hotmail.com wrote: I am attempting to write a simple Bash script that will find all the '*.pem' files in a directory structure and move them to another directory.

Re: Problem with bash script

2009-06-16 Thread Matthew Seaman
Carmel NY wrote: I am attempting to write a simple Bash script that will find all the '*.pem' files in a directory structure and move them to another directory. It seems to work until I get to the copy part where it fails. My scripting skills are not that good. Perhaps someone could tell me

Re: Problem with bash script

2009-06-16 Thread Mel Flynn
On Tuesday 16 June 2009 06:03:33 Daniel Underwood wrote: $ find ./ -name *.pem -exec cp {} /usr/home/tmp/something \; I'm a novice with shell scripting myself, but what's the difference between that code and some variant thereof using a pipe and xargs? Are they simply two different ways of

Re: Problem with bash script

2009-06-16 Thread Karl Vogel
On Tuesday, June 16, 2009 08:09:09 -0500 Carmel NY carmel...@hotmail.com wrote: C I am attempting to write a simple Bash script that will find all the C '*.pem' files in a directory structure and move them to another C directory. Using find and pax will correctly handle filenames with

Re: Problem with bash script

2009-06-16 Thread Karl Vogel
I botched the filter example in my previous blathering. This will ignore output from find containing patterns: root# find . -depth -print | fgrep -v -f /some/patterns Leaving off the -v will keep output containing those patterns. -- Karl Vogel I don't speak for the USAF