I am in the process of setting up a liveUSB that will run some scripts on a machine when it is booted. The main OS on the USB is finnix 110, and I am setting up startup scripts in the /indep/rc directory. So far, this has worked for the most part, but anytime that I want to get user input, the script just skips over the section where it is supposed to wait for input:

echo -n "[Select] /dev/:"
read sda
echo /dev/$sda selected

On startup, the read command doesn't wait for user input, and just continues with sda as a blank variable, rather than giving the user a typing prompt.

When I run ./cdrom/finnix/arch/indep/rc/test.sh the script runs fine and waits for the user's input. I'm not completely sure why it just skips this section when run as a startup script.

Is there any way that I can make this script run after startup is completed, like I do manually with the ./path/to/test.sh command? Or even, is there an alternate way that I can collect user input when it is run in the /rc/ directory at startup? I've been working on this issue for a couple days using various articles, but none of which have been able to get this working properly.

  • it sounds like this script may be running before there's anyone logged in (no getty/terminal started yet). You may want to focus on getting the script to run afterwards. – Jeff Schaller Apr 4 '17 at 11:07
  • @JeffSchaller I mentioned that as a potential solution towards the bottom of my question. The thing is, I'm not sure of the best approach to do what you're saying – pattyd Apr 4 '17 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.