3 ms·
This is the #1 reason I enjoy using the plan 9 rc shell[1] for scripts. There's exactly one place where word splitting happens: at the point where command outpu
by ori_b 3y ago
This is the #1 reason I enjoy using the plan 9 rc shell[1] for scripts. There's exactly one place where word splitting happens: at the point where command output is evaluated. And there, it's trivial to use any character you want:
x = `{echo hi there: $user} # evalutates to list ('hi' 'there:' 'ori')
y = `:{echo hi there: $user} # evalutates to list ('hi there' ' ori')
There's no other word splitting, so:
args = ('a' 'b c' 'd e f')
echo $#args
echo $args(3)
will print:
3
d e f
The shell itself is pleasantly simple; there's not much to learn[2]. And while it's not fun for interactive use on unix because it offloads too much of the interactive pleasantness to the plan 9 window system (rio), it's still great for scripting.
[1] http://shithub.us/cinap_lenrek/rc/HEAD/info.html http://shithub.us/cinap_lenrek/rc/HEAD/info.html
[2] http://man.9front.org/1/rc http://man.9front.org/1/rc