[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 - exec function not returning string list

exec function not returning string list

Q&A's, tips, howto's

exec function not returning string list

Postby TedWalther » Sat Dec 05, 2015 12:13 pm

Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
TedWalther
 
Posts: 605
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: exec function not returning string list

Postby Lutz » Sun Dec 06, 2015 4:54 pm

Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: exec function not returning string list

Postby hds1 » Tue Mar 22, 2016 10:08 am

If you want to avoid the interim file creation you could use the environment as a placeholder
i.e.

(env "willi" "<html><head></head><body>Killroy</body></html>")

(exec "echo $willi" | tidy -q 2>/dev/null)
=> ("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 3.2//EN\">" "<html>" "<head>" "<meta name=\"generator\" content="
"\"HTML Tidy for Linux (vers 25 March 2009), see http://www.w3.org\">" "<title></title>"
"</head>" "<body>" "Killroy" "</body>" "</html>")

;; cleanup a bit if you like
(env "willi" "")

I used this method with success on thousands of html files upto 2MB of size (Linux 64bit system).
Limited of course to the env you are working with.
hds1
 
Posts: 27
Joined: Thu Mar 20, 2014 5:02 pm


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron