Re: alias expansion bug with matching { ... }
Martijn Dekker dixit: >It works on every other shell, even pdksh. That’s no excuse… pdksh does simple search for a matching ) in command substitutions, failing $(case x in y) ;; esac ). >But this does not: > >$ var=$({ OPEN echo hi; CLOSE }) && echo "$var" >mksh: syntax error: ')' unexpected I see. Apparently, aliases are not parsed during recursing into the parser (the exact feature fixing the aforementioned pdksh bug). This is likely because it only needs to figure out the syntax. And… indeed: tg@blau:~ $ x() { > var=$({ OPEN echo hi; CLOSE; }) && echo "$var" > } tg@blau:~ $ typeset -f x x() { var=$({ OPEN echo hi ; CLOSE ; } ) && echo "$var" } tg@blau:~ $ x /bin/mksh: syntax error: ';' unexpected Just what I expected if my speculation was true. But: WHAT THE HEY ARE YOU DOING?! Implementing ALGOL in shell? I think “we” agreed somewhere (maybe here, maybe in IRC, maybe on the Austin ML) that doing weird things to the shell syntax with aliases need not really be supported. So, please, do tell me whether you *really* have a *legit* use case for… that. Thanks, //mirabilos -- Yay for having to rewrite other people's Bash scripts because bash suddenly stopped supporting the bash extensions they make use of -- Tonnerre Lombard in #nosec
alias expansion bug with matching { ... }
Given two aliases: $ alias OPEN='{' CLOSE='};' This works fine: $ { OPEN echo hi; CLOSE } hi And this: $ var=`{ OPEN echo hi; CLOSE }` && echo "$var" hi But this does not: $ var=$({ OPEN echo hi; CLOSE }) && echo "$var" mksh: syntax error: ')' unexpected It works on every other shell, even pdksh. Thanks, - M.
[Bug 1679426] Re: mksh arithmetic doesn't support bash **
Not a bug: There is no “**” in POSIX shell or C either. In general, the usefulness of this operator is rather limited in the scope of shell arithmetics (either mksh or POSIX), but I’ll keep this open as a wishlist item in case someone is bored or something. (No -lm allowed.) ** Changed in: mksh Importance: Undecided => Wishlist -- You received this bug notification because you are a member of mksh Mailing List, which is subscribed to mksh. Matching subscriptions: mkshlist-to-mksh-bugmail https://bugs.launchpad.net/bugs/1679426 Title: mksh arithmetic doesn't support bash ** Status in mksh: New Bug description: mksh R54 (built from source) doesn't support bash-style $((3**4)). all the other arithmetic operators appear to be there. To manage notifications about this bug go to: https://bugs.launchpad.net/mksh/+bug/1679426/+subscriptions