badsector/lil — Issue #3: conflict with string's internal present
Author: wsxiaoys
Created: 2012-01-05 10:34:14+00:00
State: open

With "catcher" function, I want to simulate a bash-like environment which could easily call system functions.

catcher {
system $args
}

With trivial arguments, it works as expected.

But in some cases:
cat sm.lil
cat: {sm.lil}: No such file or directory

echo "3+4" | bc
sh: -c: line 0: syntax error near unexpected token `}'
sh: -c: line 0: `echo {3+4} {|} bc'

The reason is obviously that lil add "{}" for strings which have special characters.
While directly call system function works well:
system cat sm.lil
system echo "3+4" | bc

My question is, is there any way I could "unwrap" the "{}" string in $args?