On 10/14/2018 10:13 AM, john doe wrote:
> Hi,
>
> With gawk I'm able to do the following:
>
> $ gawk -v pattern=try '$0 ~ "\\<"pattern"\\>"{getline;print $2}'
> ~/.ssh/config
> ~/.ssh/try/id_rsa
>
I forgot in the above command 'exit' at the end of the gawk command.
So the command in question is:
$ gawk -v pattern=try '$0 ~ "\\<"pattern"\\>"{getline;print $2;exit}'
--
John Doe