Can you use grep / awk on variables instead of files?
What I want to do is check if a pattern is found in a string variable. I'm clearly missing either a very useful command or something more even more fundamental, i.e, how to get a string variable to be piped into grep instead of a file name.
i.e., X=abcdef Y=cd how can I check if $Y is part of $X is this possible with grep / awk? Adam |
How about echo?
Code:
[hector ~]$ X='abcdef' |
honest I was trying....
can't believe it was that simple
thanx |
All times are GMT -5. The time now is 11:15 AM. |