[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - Wanting stdout, stderr and return code of shell commands

Wanting stdout, stderr and return code of shell commands

Q&A's, tips, howto's

Wanting stdout, stderr and return code of shell commands

Postby Ishpeck » Tue Nov 08, 2011 9:37 pm

When I use exec or ! to run a shell command, I want to get strings containing the contents of stdout and stderr (even if empty) as well as the exit code of the program.

I could direct the output in the command like so:
(! "ls 2>/tmp/err >/tmp/out")

And then just read those files but that seems horribly crufty.

Now exec gives me stdout but I still want exit code and stderr.

Is there a better way to see what is happening with the programs I run?
Ishpeck
 
Posts: 14
Joined: Thu Jun 09, 2011 3:53 am

Re: Wanting stdout, stderr and return code of shell commands

Postby jef » Mon Jun 02, 2014 5:44 pm

jef
 
Posts: 11
Joined: Sun May 18, 2014 8:42 am

Re: Wanting stdout, stderr and return code of shell commands

Postby ralph.ronnquist » Wed Jun 04, 2014 5:41 am

ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron