Questions:
- Solved! Is it possible to run an external cmd in background?
run(`sleep 10`)
works, but not
run(`sleep 10 \&`)
- In my docu run() is shown as
run(command, args…)
Run a command object, constructed with backticks. Throws an error if anything goes wrong, including the process exiting with a non-zero status.
How to use the comma separated syntax?
cmd = `kill`
run(cmd,12452 5467)
does not work.
- Solved! How to pass arguments correct over?
If I like to stop several processes
run(`kill 12452 5467`)
works fine. But if I generate a string of pids and try
string = “12452 5467”
run(`kill $string`)
is not working. Although if I pass Integers over
s1 = 12452
s2 = 5467
run(`kill $s1 $s2`)
it works. So how create an object which contains several integers and is accepted as argument?
Ah, try a tuple
stuple = tuple(12452,5467)
this works.
- Solved! If an external cmd fails and exit with error code 1 is
try
run()
catch
the only possibility to react on it? Or how else? Or how can I get back an empty string result?
Thx for any hints. Your help is very welcome as always.