Add {{ }}, ${{ }}, return n [x], and $:

2021-04-29 Thread konsolebox
I think these features are worth adding: {{ }} - Similar to { }, but runs like a function so variables can be declared local return n [x] - Assigns n to $? and x to $: if specified ${{ }} - Executes like {{ }} but also expands to the value of $: $: will be reset to an empty string at the beginn

Re: RFE - support option for curses idea of term [tab]size.

2021-04-29 Thread L A Walsh
On 2021/04/26 17:16, Chet Ramey wrote: On 4/26/21 7:19 PM, L A Walsh wrote: I'm not clear if termcap lib has this or not, when the curses library is in use, it supports the idea of reading and setting the term [tab]size. Can't you do this with `stty size' already? Setting size: sometimes,

Re: Brace expansion ordering vs. parameter expansion

2021-04-29 Thread Chet Ramey
On 4/29/21 12:59 PM, Tom (AST) Watson wrote: All... I've resigned to having it the way it is, but I note that the solution doesn't need the backslash escape: [tsw@box6 ~]$ k=10 [tsw@box6 ~]$ eval echo {1..$k} 1 2 3 4 5 6 7 8 9 10 This one doesn't, but putting in the slash skips the first brac

RE: Re: Brace expansion ordering vs. parameter expansion

2021-04-29 Thread Tom (AST) Watson
All... I've resigned to having it the way it is, but I note that the solution doesn't need the backslash escape: [tsw@box6 ~]$ k=10 [tsw@box6 ~]$ eval echo {1..$k} 1 2 3 4 5 6 7 8 9 10 I'm finding out lots of things as I go along. Need to understand the "features" as they show themselves. Tha

Re: Brace expansion ordering vs. parameter expansion

2021-04-29 Thread Chet Ramey
On 4/29/21 8:12 AM, Ilkka Virta wrote: Maybe, but it's never worked that way and was never intended to. You can get what you need using eval: eval echo \{1..${i}} BTW, was there some background to why they're ordered like this? I'm not sure if I have heard the story, and didn't s

Re: Brace expansion ordering vs. parameter expansion

2021-04-29 Thread Greg Wooledge
On Thu, Apr 29, 2021 at 03:12:09PM +0300, Ilkka Virta wrote: > BTW, was there some background to why they're ordered like this? I'm not > sure if I have heard the story, and didn't see anything about it in Greg's > wiki or bash-hackers.org (of course they tell the "what", but not the > "why"). I di

Brace expansion ordering vs. parameter expansion

2021-04-29 Thread Ilkka Virta
On Thu, Apr 29, 2021 at 4:18 AM Chet Ramey wrote: > Maybe, but it's never worked that way and was never intended to. You can > get what you need using eval: > > eval echo \{1..${i}} > BTW, was there some background to why they're ordered like this? I'm not sure if I have heard the story, and did

Re: Problem with sequences with variables?

2021-04-29 Thread Greg Wooledge
On Wed, Apr 28, 2021 at 11:02:31PM +, Tom (AST) Watson via Bug reports for the GNU Bourne Again SHell wrote: > Hi... > > [user@box3 ~]$ echo $l > 10 > [user@box3 ~]$ echo {1..${l}} > {1..10} https://mywiki.wooledge.org/BashPitfalls#pf33