public inbox for dash@vger.kernel.org
 help / color / mirror / Atom feed
From: Marc Chantreux <mc@unistra.fr>
To: Dash <dash@vger.kernel.org>
Subject: < "$@" doesn't expand properly?
Date: Sat, 4 Oct 2025 00:47:01 +0200	[thread overview]
Message-ID: <aOBSZYeG7UDIbOE6@prometheus> (raw)

[-- 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 --]

             reply	other threads:[~2025-10-03 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-03 22:47 Marc Chantreux [this message]
2025-10-03 23:31 ` < "$@" doesn't expand properly? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aOBSZYeG7UDIbOE6@prometheus \
    --to=mc@unistra.fr \
    --cc=dash@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox