LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I keep my script running after an install hangs at a text input screen? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-keep-my-script-running-after-an-install-hangs-at-a-text-input-screen-4175548853/)

Big_City 07-24-2015 01:46 PM

How do I keep my script running after an install hangs at a text input screen?
 
Hello,

I've created a script to install a few packages/applications on CLI Debian systems. It works fine, expect for when I install dropbox (~/.dropbox-dist/dropboxd). At the end of the dropbox install, after linking my account--when it states "welcome this machine is now linked to dropbox", it just stays on that message and give me that blank (no prompt) text input screen and prevents my script from continuing. I know I can get out of it by ctrl-C, but it also kills my script. Is there anyway to force my script to continue running when it hits this dropbox blank space?

Didier Spaier 07-24-2015 01:57 PM

Hello,

You can stop it, then put it in the background (Ctr+Z then bg). Or you can just start it in the background appending & to its name.

This can also been done sending it appropriate signals with kill

suicidaleggroll 07-24-2015 02:22 PM

It's difficult to deal with programs that don't behave, including ones that hang forever instead of returning to the caller. One thing you can do is launch the installer in the background, then use a read to wait for user input. When the dropbox installer finishes, just press enter to let your script continue on, eg:
Code:

/path/to/dropbox-install &
read
/path/to/next/installer

Of course that won't work if the dropbox installer needs input on the CLI.

Big_City 07-24-2015 03:21 PM

:-)
 
Sweet! Thanks for the tips, the "&" and "read" worked liked a charm.


All times are GMT -5. The time now is 11:03 AM.