Run lynx-dump in the background?

I have a bash script mystuffcontaining a string 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 task is terminated. I find that a lynx is a criminal. Even running this command directly from the bash prompt will immediately terminate the job:

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

Why is Lynx not running in the background? How can i fix this?

EDIT:

I use lynx because I don't want to parse raw HTML. The difference between wgetand lynx -dumpis that lynx will display HTML; it will hide all tags, nicely place text, etc.

+3
source share
4

Lynx , , SIGSTP (tty) , .

, mgb: wget. wget -O tmpfile http://example.com , , lynx .

+2

, , wget ?

+1

On my system, your lynx command works as is. Try this and see what happens:

lynx -dump -term=xterm http://example.com >tmpfile &
0
source

We were lucky to run lynx --source http_setting: // any | bash.

Running as bash allowed the background process to bypass working with my personal credentials and the absence of tty inconsistencies.

0
source

Source: https://habr.com/ru/post/1709313/


All Articles