[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFE: Make `printf -v var` support positional parameters
From: |
Chet Ramey |
Subject: |
Re: RFE: Make `printf -v var` support positional parameters |
Date: |
Thu, 5 Dec 2024 08:48:25 -0800 |
User-agent: |
Mozilla Thunderbird |
On 12/5/24 9:41 AM, Clark Wang wrote:
It would be easier to manipulate positional params if we can write like
`printf -v 1`.
Use an array. Use printf to write values to the array elements, then use
set -- "${array[@]}" (or "${array[@]:1}" depending on how closely you
want the array to parallel the positional parameters) to set the positional
parameters.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature