[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Backticked, nested command will steal piped stdin
From: |
Greg Wooledge |
Subject: |
Re: Backticked, nested command will steal piped stdin |
Date: |
Tue, 30 Jul 2024 14:39:27 -0400 |
On Tue, Jul 30, 2024 at 14:06:21 -0400, Dale R. Worley wrote:
> In your case, you probably want
>
> > $ seq 3 | head -n $(</dev/null calc -dp "1+1")
Or:
seq 3 | head -n $((1+1))
There's no reason to call an external calculator program to add 1+1
when bash's builtin arithmetic can do it.
Then again, this might be a "bashphorism 9" situation.
9. All examples given by the questioner will be broken, misleading,
wrong, incomplete, and/or not representative of the actual question.
9.5: Especially when the example is 'ls'.