[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing file arguments to programs
From: |
Greg Wooledge |
Subject: |
Re: Passing file arguments to programs |
Date: |
Wed, 29 Mar 2023 15:57:26 -0400 |
On Wed, Mar 29, 2023 at 07:46:13PM +0000, uzibalqa wrote:
> grep --color $ptrn <<< "$@"
This makes no sense at all.
The <<< operator is followed by a WORD. Not by a LIST.
"$@" expands to a LIST.
Did you intend for grep to iterate through the positional parameters,
and only print the parameters that match your "ptrn"? If so, this code
does not achieve that.
Also, you failed to quote "$ptrn".