bug-gawk
[Top][All Lists]
Advanced

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

Re: How to read stdin as well as files?


From: Davide Brini
Subject: Re: How to read stdin as well as files?
Date: Fri, 28 Feb 2020 18:48:14 +0100

On Fri, 28 Feb 2020 11:21:27 -0600, Peng Yu <address@hidden> wrote:

> The following example shows that when files are specified, stdin will
> not be read.
>
> What is the best way to first read stdin then read the files (knowing
> where the data is from)? Thanks.
>
> $ seq 3 | awk -e '{ print FILENAME, $0 }' <(printf '%s\n' {a..c})
> <(printf '%s\n' {A..B})
> /dev/fd/63 a
> /dev/fd/63 b
> /dev/fd/63 c
> /dev/fd/62 A
> /dev/fd/62 B

seq 3 | awk -e '{ print FILENAME, $0 }' - <(printf '%s\n' {a..c})

--
D.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]