|
Prev: Run a PL SQL Package from a shell script
Next: newbie qn: shell program to copy files from one directory on the server to a remote windows machine on the same network
From: compboy on 2 Sep 2006 00:18 Hi, Im having problem in using find esp the -prune I want to find txt files from the path from the command line input but I dont want to get the txt files from path given on the second argument so it will be like this >./script /$HOME /$HOME/notthis and my script is about like this find $1 -name "*.txt" where should I put the -prune? so the files inside the /notthis directory will not be listed. Thanks a lot.
From: Bill Marcum on 2 Sep 2006 02:06 On 1 Sep 2006 21:18:36 -0700, compboy <compboyxyz(a)gmail.com> wrote: > Hi, > > Im having problem in using find esp the -prune > > I want to find txt files from the path from the command line input > but I dont want to get the txt files from path given on the second > argument > > so it will be like this > >>./script /$HOME /$HOME/notthis > > and my script is about like this > > find $1 -name "*.txt" > > where should I put the -prune? so the files inside the /notthis > directory will not be listed. > > Thanks a lot. > find "$1" -name "$2" -prune -o -name "*.txt" -- People in general do not willingly read if they have anything else to amuse them. -- S. Johnson
From: compboy on 2 Sep 2006 02:18 Hmmm, how if the second argument is a directory? thanks. Bill Marcum wrote: > On 1 Sep 2006 21:18:36 -0700, compboy > <compboyxyz(a)gmail.com> wrote: > > Hi, > > > > Im having problem in using find esp the -prune > > > > I want to find txt files from the path from the command line input > > but I dont want to get the txt files from path given on the second > > argument > > > > so it will be like this > > > >>./script /$HOME /$HOME/notthis > > > > and my script is about like this > > > > find $1 -name "*.txt" > > > > where should I put the -prune? so the files inside the /notthis > > directory will not be listed. > > > > Thanks a lot. > > > find "$1" -name "$2" -prune -o -name "*.txt" > > -- > People in general do not willingly read if they have anything else to > amuse them. > -- S. Johnson
From: compboy on 2 Sep 2006 05:11 I have tried to do it that way but it didnt work thanks Bill Marcum wrote: > On 1 Sep 2006 21:18:36 -0700, compboy > <compboyxyz(a)gmail.com> wrote: > > Hi, > > > > Im having problem in using find esp the -prune > > > > I want to find txt files from the path from the command line input > > but I dont want to get the txt files from path given on the second > > argument > > > > so it will be like this > > > >>./script /$HOME /$HOME/notthis > > > > and my script is about like this > > > > find $1 -name "*.txt" > > > > where should I put the -prune? so the files inside the /notthis > > directory will not be listed. > > > > Thanks a lot. > > > find "$1" -name "$2" -prune -o -name "*.txt" > > -- > People in general do not willingly read if they have anything else to > amuse them. > -- S. Johnson
From: Stephane CHAZELAS on 2 Sep 2006 07:17
2006-09-1, 23:18(-07), compboy: > Hmmm, > > how if the second argument is a directory? > > >> find "$1" -name "$2" -prune -o -name "*.txt" [...] Please don't top-post. Then, you need a find with the -path option. find "$1" -path "$2" -prune -o -name '*.txt' -print -- St?phane |