; Try the -w (grep for word) option.
;
; Also you could reduce the pipeline to:
;
; grep -w $TMP < /tmp/modemlist$$.tmp 2>/dev/null | tail -1
;
You can eliminate all forking by learning some sed, although admittedly this
is slighly less readable to novices than the grep -w|tail solution.
(that stdin redir is redundant btw).
sed '/ '$a' /!d;h;${g;p;};d' /tmp/modemlist.$$.tmp
r.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug
- [SLUG] Grepping a variable and spaces. George Vieira
- Re: [SLUG] Grepping a variable and spaces. Damien Gardner Jnr
- Re: [SLUG] Grepping a variable and spaces. John Clarke
- Re: [SLUG] Grepping a variable and spaces. Russell Davies
- Re: [SLUG] Grepping a variable and spaces. Ken Yap
- Re: [SLUG] Grepping a variable and spaces. Russell Davies
- Re: [SLUG] Grepping a variable and spaces. Russell Davies
