Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Shell confusion over positional argumentsX
- Subject: Re: Shell confusion over positional argumentsX
- From: Ken Hornstein <kenh%pobox.com@localhost>
- Date: Mon, 10 Mar 2025 12:23:18 -0400
>>Hello. A /bin/sh script I wrote about 10 years ago under NetBSD-5
>>broke under NetbSD-10.99.12. The issue seems to be a change in the way
>>command line arguments are assigned to the $number variables, i.e. $1,
>>$2, $3, etc.
>
>Looks to me like $11 is being interpreted as ${1}1. I wonder what ${11}
>comes out as?
Following up to myself, from section 2.5.1 of:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
When a positional parameter with more than one digit is specified,
the application shall enclose the digits in braces (see Parameter
Expansion).
--Ken
Home |
Main Index |
Thread Index |
Old Index