> Kerry LeBlanc > Materials Auditor > Process Owner > 75 Perseverence Way > Hyannis, MA. 02601 > 1-508-862-3082 > http://www.vsf.cape.com/~bismark > > > > #make sure $part_num is formatted correctly to keep someone > form doing bad things with the backtick execution > > I am not familiar with the term backtick so I do not really
You can put system commands in backticks, the funny looking quote under the tilde(~), And execute system commands as if you had typed them at the prompt. Very useful but very dangerouse if somebody input some evil command to reformat your hardrive and tehn you have you script execute it blindly! > understand your warning. The part number will be entered to > look like this: 68-2208-04 At what part of my code would I > put a statement like this? Would it be before the open > statement or replace it? Thanks > > $data = `cat file.txt |grep $part_num`; > > if($data) { print "Here is your info :\n$data\n"; } > else { print info to file or whatever here } > > > > You like newlines a lot don't you :) > > The newlines are not permanent. I use them to space out the > outputs in my dos window so that I can follow it easier. They > will be removed. :) Gotcha! Dos huh? The command I had above is a unix command. Not sure how you'd do that in winders. You may have to open the file into an array then do a regex on each line in the array. Not sure, I don't use windows for anything but getting email,ssh inginto unix, at work because I have to, and because I can't afford an Imac right now. > > > Kerry > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]