[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Which tool, and how, to get partial string from file?



Thomas Adam wrote:

On Fri, Aug 20, 2004 at 03:27:34PM -0500, Kent West wrote:
solution. I'm hoping one of you whiz-guys can provide me an answer in about ten seconds.

Is this want you want (as an example):

[n6tadam@station ~]$ echo this is a word in a line | grep -o word word

So for your script:

grep -o "word" ./file

If I understand you correctly.
Ah, that looks great. Unfortunately:

snert[@macs51]:/home.local/snert> grep -o alias .bashrc
grep: invalid option -- o
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

and "man grep" doesn't seem to have an "-o" option.

--
Kent




Reply to: