Re: Word-boundary mawk Debian Stretch

2018-10-15 Thread john doe
On 10/14/2018 1:55 PM, Étienne Mollier wrote: > > > 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 "\<${pa

Re: Word-boundary mawk Debian Stretch

2018-10-14 Thread Étienne Mollier
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 (

Re: Word-boundary mawk Debian Stretch

2018-10-14 Thread john doe
On 10/14/2018 1:24 PM, Étienne Mollier wrote: > John Doe, on 2018-10-14: >> Hi, > > Good Day, > >> With gawk I'm able to do the following: >> >> $ gawk -v pattern=try '$0 ~ "\\<"pattern"\\>"{getline;print $2}' >> ~/.ssh/config >> ~/.ssh/try/id_rsa >> >> $ cat ~/.ssh/config >> Host try >> Identity

Re: Word-boundary mawk Debian Stretch

2018-10-14 Thread john doe
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:

Re: Word-boundary mawk Debian Stretch

2018-10-14 Thread Étienne Mollier
John Doe, on 2018-10-14: > Hi, Good Day, > With gawk I'm able to do the following: > > $ gawk -v pattern=try '$0 ~ "\\<"pattern"\\>"{getline;print $2}' > ~/.ssh/config > ~/.ssh/try/id_rsa > > $ cat ~/.ssh/config > Host try > IdentityFile ~/.ssh/try/id_rsa > > I don't want to install extra pkgs on

Word-boundary mawk Debian Stretch

2018-10-14 Thread john doe
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 $ cat ~/.ssh/config Host try IdentityFile ~/.ssh/try/id_rsa I don't want to install extra pkgs on Debian Stretch (9). Googling around didn't turn out some