Author Topic: Script  (Read 2202 times)

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Script
« on: November 11, 2005, 04:59:03 am »
how do I request a keyboard input wait for that input then use that input and pass it as a variable?
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

zmiq2

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
    • http://
Script
« Reply #1 on: November 11, 2005, 06:20:18 am »
I assume you are thinking about doing an input from a bash script. If not, forget about this solution:

echo -n "Enter input:"
read inputLine
echo "your input was: $inputLine"

HTH
sl-c750, archos av580, socket cf [bt, wifi, modem], noname cf lan, audiovox rtm800 gsm-gprs cf, rom: sharp -> oz3.5.3 -> cacko -> oz3.5.4.1

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Script
« Reply #2 on: November 11, 2005, 06:34:27 am »
yes, bash. I am going to have this at the end of rc.rofilesys to decide the runlevel, so as to boot to debian or qtopia. Then the next step is to figure out how to login as root (automatically) when terminal ocmes up, then run Vncserver and Fbvnc.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Script
« Reply #3 on: November 12, 2005, 02:37:12 am »
one more quick question, how can I set a "timer" to just do an action after it waits for an input, example, it asks for a runlevel, if you dont answer in say 5 seconds it sends a default value along.
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder