|
Prev: Can sed match a choice of two?
Next: Comparing Files
From: apogeusistemas on 24 Apr 2008 09:25 Hi: Can you tell me why when I run this script I only get this output ? solaris> cat script1 for file in `ls -R` do grep -iw alter $file > /apl/applprox/script1_output grep -iw modify $file >> /apl/applprox/script1_output grep -iw replace $file >> /apl/applprox/script1_output done grep: can't open OEXWFOIB.pls grep: can't open OEXWFOIB.pls grep: can't open OEXWFOIS.pls grep: can't open OEXWFOIS.pls grep: can't open OEXWFOIS.pls grep: can't open OEXXHDRB.pls grep: can't open OEXXHDRB.pls grep: can't open OEXXHDRB.pls grep: can't open OEXXHDRS.pls grep: can't open OEXXHDRS.pls grep: can't open OEXXHDRS.pls grep: can't open OEXXLINB.pls grep: can't open OEXXLINB.pls
From: pk on 24 Apr 2008 09:30 On Thursday 24 April 2008 15:25, apogeusistemas(a)gmail.com wrote: > > Hi: > > Can you tell me why when I run this script I only get this output ? (looks into the crystal ball...) > > solaris> cat script1 > > for file in `ls -R` > do > grep -iw alter $file > /apl/applprox/script1_output > grep -iw modify $file >> /apl/applprox/script1_output > grep -iw replace $file >> /apl/applprox/script1_output > done > > > > grep: can't open OEXWFOIB.pls > grep: can't open OEXWFOIB.pls > grep: can't open OEXWFOIS.pls > grep: can't open OEXWFOIS.pls > grep: can't open OEXWFOIS.pls > grep: can't open OEXXHDRB.pls > grep: can't open OEXXHDRB.pls > grep: can't open OEXXHDRB.pls > grep: can't open OEXXHDRS.pls > grep: can't open OEXXHDRS.pls > grep: can't open OEXXHDRS.pls > grep: can't open OEXXLINB.pls > grep: can't open OEXXLINB.pls - Are you sure you fully understand the output of ls -R? - what other output should you get? You are redirecting stdout. - are you sure you fully understand redirection operators? -- All the commands are tested with bash and GNU tools, so they may use nonstandard features. I try to mention when something is nonstandard (if I'm aware of that), but I may miss something. Corrections are welcome.
From: apogeusistemas on 24 Apr 2008 10:17 On Apr 24, 10:30 am, pk <p...(a)pk.invalid> wrote: > On Thursday 24 April 2008 15:25, apogeusiste...(a)gmail.com wrote: > > > > > Hi: > > > Can you tell me why when I run this script I only get this output ? > > (looks into the crystal ball...) > > > > > > > > > solaris> cat script1 > > > for file in `ls -R` > > do > > grep -iw alter $file > /apl/applprox/script1_output > > grep -iw modify $file >> /apl/applprox/script1_output > > grep -iw replace $file >> /apl/applprox/script1_output > > done > > > grep: can't open OEXWFOIB.pls > > grep: can't open OEXWFOIB.pls > > grep: can't open OEXWFOIS.pls > > grep: can't open OEXWFOIS.pls > > grep: can't open OEXWFOIS.pls > > grep: can't open OEXXHDRB.pls > > grep: can't open OEXXHDRB.pls > > grep: can't open OEXXHDRB.pls > > grep: can't open OEXXHDRS.pls > > grep: can't open OEXXHDRS.pls > > grep: can't open OEXXHDRS.pls > > grep: can't open OEXXLINB.pls > > grep: can't open OEXXLINB.pls > > - Are you sure you fully understand the output of ls -R? > - what other output should you get? You are redirecting stdout. > - are you sure you fully understand redirection operators? > > -- > All the commands are tested with bash and GNU tools, so they may use > nonstandard features. I try to mention when something is nonstandard (if > I'm aware of that), but I may miss something. Corrections are welcome.- Hide quoted text - > > - Show quoted text - I need find all occurences of alter, modify and replace in all files, how could I make this ? Thank you
From: Janis on 24 Apr 2008 10:32 On 24 Apr., 16:17, apogeusiste...(a)gmail.com wrote: > On Apr 24, 10:30 am, pk <p...(a)pk.invalid> wrote: > > > > > > > On Thursday 24 April 2008 15:25, apogeusiste...(a)gmail.com wrote: > > > > Hi: > > > > Can you tell me why when I run this script I only get this output ? > > > (looks into the crystal ball...) > > > > solaris> cat script1 > > > > for file in `ls -R` > > > do > > > grep -iw alter $file > /apl/applprox/script1_output > > > grep -iw modify $file >> /apl/applprox/script1_output > > > grep -iw replace $file >> /apl/applprox/script1_output > > > done > > > > grep: can't open OEXWFOIB.pls > > > grep: can't open OEXWFOIB.pls > > > grep: can't open OEXWFOIS.pls > > > grep: can't open OEXWFOIS.pls > > > grep: can't open OEXWFOIS.pls > > > grep: can't open OEXXHDRB.pls > > > grep: can't open OEXXHDRB.pls > > > grep: can't open OEXXHDRB.pls > > > grep: can't open OEXXHDRS.pls > > > grep: can't open OEXXHDRS.pls > > > grep: can't open OEXXHDRS.pls > > > grep: can't open OEXXLINB.pls > > > grep: can't open OEXXLINB.pls > > > - Are you sure you fully understand the output of ls -R? > > - what other output should you get? You are redirecting stdout. > > - are you sure you fully understand redirection operators? > > > -- > > All the commands are tested with bash and GNU tools, so they may use > > nonstandard features. I try to mention when something is nonstandard (if > > I'm aware of that), but I may miss something. Corrections are welcome.- Hide quoted text - > > I need find all occurences of alter, modify and replace in all files, > how could I make this ? > > Thank you Somthing like... find . -type f | xargs egrep -iw '(alter|modify|replace)' >outfile (You need to tweak it slightly if your filenames contain e.g. spaces and/or if your grep doesn't support option -w.) Janis
From: mallin.shetland on 24 Apr 2008 10:32
apogeusistemas(a)gmail.com scrisse: > I need find all occurences of alter, modify and replace in all files, > how could I make this ? grep -R -e alter -e modify -e replace * PS Over fifty lines of quotation before a two line post: revise your quoting style. -- Bottom posting sucks! |