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

Re: Word-boundary mawk Debian Stretch




On 10/14/18 1:47 PM, john doe wrote:
> Thank you, I was hoping for something with less pipes redirection but
> given that portability is required, I might as wel go that way! :)

Sure, one less:

	$ pattern=try grep -A1 -E "\<${pattern}\>" | mawk '{getline;print $2;exit}'
(in)	noise
(in)	Host try
(in)	IdentityFile ~/.ssh/try/id_rsa1
(in)	noise
(in)	Host try
(in)	IdentityFile ~/.ssh/try/id_rsa2
(in)	noise
(out)	~/.ssh/try/id_rsa1

and it should work as expected, this time.  :-)

Kind Regards,
-- 
Étienne Mollier <etienne.mollier@mailoo.org>


Reply to: