script.nims
mode = ScriptMode.Verbose
exec "ls"
bash
localhost:mytest xxx$ nim e script.nims
[NimScript] exec: ls
localhost:mytest xxx$
It works for me on 10.10.5?
[/tmp/nstest]$ cat script.nims
mode = ScriptMode.Verbose
exec "ls"
[/tmp/nstest]$ ls
script.nims
[/tmp/nstest]$ nim e script.nims
[NimScript] exec: ls
script.nims
@Araq: exec uses osproc.execCmd, which calls out to system(), which does execute the command via /bin/sh, so shell built-ins work. However, ls is not a built-in command, but lives in /bin/ls.
I always install my "unix commands" zip on windows: ls.exe, find.exe, grep.exe, rm.exe, cat.exe + some more. Because I like them more than the strange windows commands :-P
But generally I think that nimscript should be able to run shell commands anyway.
BTW: It works for me on 10.11.1 too
It doesn't matter if you prefer the Unix commands (*) and also have them available on Windows or not, the point is to minimize the number of dependencies required to build Nim software.
(*) Which all suck anyway... Nimgrep ftw! ;-)
Well I talked about Nimscript as a scripting language for those people loving to use anything related to Nim. Which probably use Nimscript together with Linux commands on Windows because they hate to use Linux commands in a .bat file :-)
Anyway. I think it would be interesting to find out why it does not work for OP. Hey could use exec "nimgrep 'Hello\sWorld'" to make it more interesting :-P
Which leads me to the question why nimgrep 'Hello World' . does not find Hello World in website.tmpl but nimgrep 'Hello\sWorld' . does?