Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: nim108 on July 19, 2012, 10:35:33 AM
-
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?
-
bootlocal is backgrounded. For interactive/sync use, use bootsync.sh.
-
Jeez!! now you tell me... :P
-
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?
-
As always, thank you curaga, that was simple enough ... coreplayer, I had no idea either :-\
-
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..
-
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 ;)
-
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!