WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: bootlocal.sh not processing "read" prompts  (Read 3330 times)

Offline nim108

  • Full Member
  • ***
  • Posts: 107
bootlocal.sh not processing "read" prompts
« on: July 19, 2012, 01:35:33 PM »
I am launching an external shell script through bootlocal.sh (i.e. sudo sh /home/tc/test.sh, same result with sudo /home/tc/test.sh) which has a read in it to prompt the user for some input:

read -n1 -r -p "Press any key to continue..."
echo ""

However, bootlocal.sh nor any script I run from it pauses at all, it just runs through the whole script as if there were no "read" in there. I should add that if I run this script manually once TC is up through the terminal (I am not using any X extensions, this is plain core), it works fine and prompts for user input. Am I not running this correctly? Is bootlocal.sh supposed to autorun through everything?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: bootlocal.sh not processing "read" prompts
« Reply #1 on: July 19, 2012, 03:12:50 PM »
bootlocal is backgrounded. For interactive/sync use, use bootsync.sh.
The only barriers that can stop you are the ones you create yourself.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: bootlocal.sh not processing "read" prompts
« Reply #2 on: July 19, 2012, 10:44:09 PM »
Jeez!! now you tell me...   :P

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: bootlocal.sh not processing "read" prompts
« Reply #3 on: July 19, 2012, 11:01:00 PM »
Ok taking the OP's question one step further...  how about running two scripts, the first is not interactive but must complete prior to the second script which is interactive.?


bootsync.sh

/path/first_scrip.sh;
/path/second_script.sh


Perhaps?
« Last Edit: July 19, 2012, 11:04:45 PM by coreplayer2 »

Offline nim108

  • Full Member
  • ***
  • Posts: 107
Re: bootlocal.sh not processing "read" prompts
« Reply #4 on: July 20, 2012, 08:14:42 AM »
As always, thank you curaga, that was simple enough ... coreplayer, I had no idea either  :-\

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: bootlocal.sh not processing "read" prompts
« Reply #5 on: July 20, 2012, 07:45:33 PM »
I hear you, I would never have guessed running in asynchronous mode would cause the script to run like that.   Learn something new every day around here..

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: bootlocal.sh not processing "read" prompts
« Reply #6 on: July 22, 2012, 12:08:57 PM »
Quote
Ok taking the OP's question one step further...  how about running two scripts, the first is not interactive but must complete prior to the second script which is interactive.?

Yes, that way works. The ';' is unneeded there, but doesn't hurt.

BTW, this is commented on top of both bootlocal and bootsync files, IIRC ("use this file for asynchronous use", "use this file for sync use" or equivalent). Patches welcome if the comments weren't descriptive enough ;)
The only barriers that can stop you are the ones you create yourself.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: bootlocal.sh not processing "read" prompts
« Reply #7 on: July 22, 2012, 11:13:26 PM »
Thanks Curaga

I think the commented instructions (well there are some...) relating to synchronous must have gotten relocated to /dev/null at some point in history.. :(

though bootSYNC is kind of a clue..   I just never put the two meanings together doh!
« Last Edit: July 22, 2012, 11:35:46 PM by coreplayer2 »