Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run lynx -dump in background?

I have a bash script mystuff containing a line like

lynx -dump http://example.com >tmpfile

and the script works fine, including this part, except when I run it non-interactively:

$ ./mystuff &
[1] 3712
$ jobs
[1]+ Stopped

The job is stopped. I find that lynx is the culprit. Even running this command directly from the bash prompt causes the job to be stopped immediately:

$ lynx -dump http://example.com >tmpfile &
[1] 1836
$ jobs
[1]+ Stopped

Why won't lynx run in the background? How can I fix this?

EDIT:

I am using lynx because I don't want to have to parse the raw HTML. The difference between wget and lynx -dump is that lynx will render the HTML; it will hide all the tags, arrange text nicely, etc.

like image 307
system PAUSE Avatar asked May 10 '26 15:05

system PAUSE


1 Answers

Lynx wants to talk to your terminal, but can't, so it does a SIGSTP (tty input) and waits for you to foreground the process.

As mgb said above: use wget. wget -O tmpfile http://example.com does the same thing as what you're doing with lynx above.

like image 92
joshk0 Avatar answered May 13 '26 06:05

joshk0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!