passing format a list of strings
Posted: Mon Feb 21, 2011 9:16 am
I have a function run-sh defined as so:run-sh is a kind of basic function that takes input sTr - the shell command.
newLISP can call it like this:or, so i wish. The problem is this is my error message:I know you're probably wondering 'why not use (exec ...?' but, let's say, if I wanted to do this, how can i pass a list of strings to run-sh such that the first string is the command name, and have newLISP pass the remaining strings as the command's arguments?
ยป; }
Code: Select all
(define (run-sh sTr) (exec (format {'%s'} sTr)))
newLISP can call it like this:
Code: Select all
(run-sh {ls -a -l})
Code: Select all
sh: ls -a -l: command not found
ยป; }