$ mocp 2>/dev/null
Running the server...
Trying OSS...
$ mocp &>/dev/null
$
$ newlisp -e "(exec {mocp -i 2>/dev/null})"
()
$
Using (exec {mocp -i 2>/dev/null}) or (exec {mocp -i &>/dev/null}) in a script, I'm getting errors in the bash which is calling the script, even when I call the script with & at the end. Version: newLISP v.10.6.2 32-bit on Linux IPv4/6 UTF-8 libffi.
redirecting stderr not working
Re: redirecting stderr not working
You could try redirecting not to null but to stdout, then let newLISP handle stdout.
In file: script
now script has no output and the error message is in the return value from exec.
Ps: just tried your example with (exec "mocp -i 2>/dev/null") in a script and it works fine for me on Linux UBUNTU 14.04, also suppressing error output.
In file: script
Code: Select all
#!/usr/bin/env newlisp
(exec "mocp -i 2>&1")
(exit)
Code: Select all
~> ./script
~> newlisp -e '(exec "mocp -i 2>&1")'
("sh: mocp: command not found")
~> ./script
~>
-
- Posts: 18
- Joined: Fri Aug 08, 2014 6:08 pm
Re: redirecting stderr not working
Many thanks, it works for me now how it should. I think I did something wrong somewhere.
However, the idea with redirecting it to stdout and then using the output in newlisp can be helpfull in other cases. I'm gonna keep that in mind.
However, the idea with redirecting it to stdout and then using the output in newlisp can be helpfull in other cases. I'm gonna keep that in mind.