diff --git a/clite/core.js b/clite/core.js index 8b08d2f..f42f9da 100644 --- a/clite/core.js +++ b/clite/core.js @@ -1355,7 +1355,7 @@ clite.lib = { path = '/'+parts.join('/'); return path; }, - // convert a string into an argument array: 'ls /etc' -> ['ls','/etc'] + // convert a string into an argument array: 'ls /etc' -> ['ls','/etc'], supports "quoted arguments" and `command substitutions` strToArgs:function(txt) { var parts = []; var sp = ''; @@ -1377,8 +1377,12 @@ clite.lib = { if (!q) { sp = txt[i]; q = true; + if (sp == '`'); + s += '`'; break; }else if (txt[i] == sp) { + if (sp == '`'); + s += '`'; sp = ''; q = false; }