9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.61k stars 319 forks source link

Incompatibility: Implicit concatenation of `{cmd}x sequences #592

Open euclaise opened 1 year ago

euclaise commented 1 year ago

This one caused an accidental rm -rf /*...

Behavior on 9front and in https://github.com/rakitzis/rc:

image

euclaise@thinkpad fort $ rc                                                                                                                                                              git
; root=`{pwd}/root
rc: /root: Permission denied

Behavior of plan9port rc:

euclaise@thinkpad fort 1 $ 9 rc                                                                                                                                                          git
% root=`{pwd}/root
% echo $root
/home/euclaise/Projects/fort/root
%

It seems plan9port's rc is implicitly concatenating here, but the others aren't.

I'm on Arch Linux using the plan9port package, version 20220818-1.

wgrr commented 1 year ago

I think this is one of the intentional divergences from plan9 rc introduced by p9p's rc parser. There's an -Y flag which makes rc use the old yacc-based parser, does that gives you the desired behavior?

euclaise commented 1 year ago

Oh, indeed it does