On 04.08.2016 10:29, Kenny McCormack wrote:
> I've never heard of this before, but it seems to work.
>
> I was watching a YouTube vid about AWK, and it showed the following syntax:
>
> { print $1.$2 }
>
> which seems to do the exact same thing as if the dot weren't there.
>
> It seems to work. Is this standard?
It doesn't work with GNU awk...
$ awk '{ x=$1; y=$2; print x.y }'
awk: cmd. line:1: { x=$1; y=$2; print x.y }
awk: cmd. line:1: ^ syntax error
$ awk '{ x=$1; y=$2; print x . y }'
awk: cmd. line:1: { x=$1; y=$2; print x . y }
awk: cmd. line:1: ^ syntax error
$ awk '{ print $1 . $2 }'
awk: cmd. line:1: { print $1 . $2 }
awk: cmd. line:1: ^ syntax error
$ awk '{ print $(1).$2 }'
awk: cmd. line:1: { print $(1).$2 }
awk: cmd. line:1: ^ syntax error
It's no concatenation operator. (Ignore unreliable obscure web sources.)
To me pop's explanation makes sense...
$ awk '{ print $(1.)$2 }'
# no error
Janis