public inbox for dash@vger.kernel.org
 help / color / mirror / Atom feed
* < "$@" doesn't expand properly?
@ 2025-10-03 22:47 Marc Chantreux
  2025-10-03 23:31 ` Lawrence Velázquez
  0 siblings, 1 reply; 7+ messages in thread
From: Marc Chantreux @ 2025-10-03 22:47 UTC (permalink / raw)
  To: Dash

[-- Attachment #1: Type: text/plain, Size: 727 bytes --]

hello everyone,

I wrote a simple "inplace" script to be able to
work with commands that have no -i options.

The simplest way to do it (I thought) was

#!/bin/sh
set -eux
< "$@" | sponge "$1"

so inplace counter awk '{$0+=2}1' would be expanded
as

< 'counter' 'awk' '{$0+=2}1' | sponge 'counter'


but there is an error message

./inplace: 3: cannot open counter awk {$0+=2}1: No such file

so it seems that the expansion leads to

< 'counter awk {$0+=2}1' | sponge 'counter'

is this an expected behavior?

regards

-- 
Marc Chantreux
Pôle CESAR (Calcul et services avancés à la recherche)
Université de Strasbourg
14 rue René Descartes,
BP 80010, 67084 STRASBOURG CEDEX
03.68.85.60.79


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-05  7:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-03 22:47 < "$@" doesn't expand properly? Marc Chantreux
2025-10-03 23:31 ` Lawrence Velázquez
2025-10-04  6:55   ` Marc Chantreux
2025-10-04 11:42     ` Harald van Dijk
2025-10-04 13:31       ` Marc Chantreux
2025-10-04 15:13     ` Lawrence Velázquez
2025-10-05  7:21       ` Marc Chantreux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox