[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf '%s\n' "$@" versus <<< redirection
From: |
goncholden |
Subject: |
Re: printf '%s\n' "$@" versus <<< redirection |
Date: |
Mon, 20 Feb 2023 12:31:11 +0000 |
------- Original Message -------
On Monday, February 20th, 2023 at 1:51 AM, Greg Wooledge <greg@wooledge.org>
wrote:
> On Sun, Feb 19, 2023 at 10:00:17AM +0000, goncholden wrote:
>
> > theone()
> > (
> > for arg in "$@"
> > do
> > while IFS= read -r vl
> > do
> > printf '## vl: %s ##\n' "$vl"
> > done <<< "$arg"
> > done
> > )
Does the problem of disappearing variables exist in
calls to awk ?
for arg in "$@"; do
printf '%s\n' "$arg" | awk '...'
done
or should one use
for arg in "$@"; do
awk '...' < <(printf '%s\n' "$arg")
done
There is also the possibility of putting the awk command in the process
substitution, not the printf command:
for arg in "$@"; do
while read ...; do
...
done < <(awk '...' <<< "$arg")
done
- Re: printf '%s\n' "$@" versus <<< redirection, (continued)
- Re: printf '%s\n' "$@" versus <<< redirection, alex xmb ratchev, 2023/02/18
- Re: printf '%s\n' "$@" versus <<< redirection, Mike Jonkmans, 2023/02/18
- Re: printf '%s\n' "$@" versus <<< redirection, Kerin Millar, 2023/02/18
- Re: printf '%s\n' "$@" versus <<< redirection, goncholden, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection, Kerin Millar, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection, Greg Wooledge, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection, Kerin Millar, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection, Greg Wooledge, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection, Kerin Millar, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection, Greg Wooledge, 2023/02/19
- Re: printf '%s\n' "$@" versus <<< redirection,
goncholden <=
- Re: printf '%s\n' "$@" versus <<< redirection, Greg Wooledge, 2023/02/20
- Re: printf '%s\n' "$@" versus <<< redirection, goncholden, 2023/02/20
- Re: printf '%s\n' "$@" versus <<< redirection, Chet Ramey, 2023/02/20
- Re: printf '%s\n' "$@" versus <<< redirection, Mike Jonkmans, 2023/02/20
- Re: printf '%s\n' "$@" versus <<< redirection, Greg Wooledge, 2023/02/20
- Re: printf '%s\n' "$@" versus <<< redirection, Mike Jonkmans, 2023/02/21
- Re: printf '%s\n' "$@" versus <<< redirection, Chet Ramey, 2023/02/21
- Re: printf '%s\n' "$@" versus <<< redirection, Chet Ramey, 2023/02/21