Sponsored Content
Full Discussion: Why cant?
Top Forums UNIX for Dummies Questions & Answers Why cant? Post 4868 by AkumaTay on Thursday 2nd of August 2001 03:30:47 AM
Old 08-02-2001
Why cant?

I need to verify wether a file is exist or not be4 i proceed to my next stage.

So i wrote it like tat:

if [ ! ' ls | grep '^data.dat' ' ]
then
.................
else
................
fi

But the result is not i want!!! Smilie

* i tried : if [ ' ! ls | grep '^data.dat' ' ] oso

Second...about the passing argument ot awk script.

I tried the way awk -f generate.awk data.dat awk_serial=$serial
But i dun seems to get access to awk_serial in the awk script.

When i try to echo $awk_serial there...they say file awk_serial not found.... Smilie

Pls help!! pls...pls.....Thx
 
GREP(1) 						      General Commands Manual							   GREP(1)

NAME
grep - search a file for lines containing a given pattern SYNOPSIS
grep [-elnsv] pattern [file] ... OPTIONS
-e -e pattern is the same as pattern -c Print a count of lines matched -i Ignore case -l Print file names, no lines -n Print line numbers -s Status only, no printed output -v Select lines that do not match EXAMPLES
grep mouse file # Find lines in file containing mouse grep [0-9] file # Print lines containing a digit DESCRIPTION
Grep searches one or more files (by default, stdin) and selects out all the lines that match the pattern. All the regular expressions accepted by ed and mined are allowed. In addition, + can be used instead of * to mean 1 or more occurrences, ? can be used to mean 0 or 1 occurrences, and | can be used between two regular expressions to mean either one of them. Parentheses can be used for grouping. If a match is found, exit status 0 is returned. If no match is found, exit status 1 is returned. If an error is detected, exit status 2 is returned. SEE ALSO
cgrep(1), fgrep(1), sed(1), awk(9). GREP(1)
All times are GMT -4. The time now is 07:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy