-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rc: introduce automatically quoted mini syntax
This is an experimental change that propose an explicit mini syntax that automatically quote arguments like --foo=bar -DMACRO=baz if=file of=file This mini-syntax is enabled by a single '$' that marks the end of variable assignments in a command. The scope of the syntax is a single command: it's automatically turned of on &, &&, || and so on. The price of this sugar is that you can't define variables after the $ marker till the end of the command. Some examples: % a=1 echo b=$a rc: #d/0: token '=': syntax error % a=1 $ echo b=$a b=1 % $ eval prefix=$home/foo && echo $prefix /usr/glenda/foo % $ eval prefix=$home/foo; echo ./configure --prefix=$prefix rc: #d/0: token '=': syntax error % $ eval prefix=$home/foo; $ echo ./configure --prefix=$prefix ./configure --prefix=/usr/glenda/foo % inf=/dev/random out=/dev/null $ echo dd if=$inf of=$out dd if=/dev/random of=/dev/null Also read on 9fans http://marc.info/?t=149366703800002&r=1&w=2
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters