-   Programming (
-   -   return key on shell script (

chupacabra 10-22-2002 10:57 AM

return key on shell script
kernel : 2.4.48-14
distro: redhat 8.0
shell: BASH

Which symbol or command is the Return key? I mean, to make the shell script to press "enter" automatically?

I'm trying to automate this one command via cron. The rest of the script runs fine but after the following line it asks me to press return.

cdbkup 0 --label=TEST -s 4 0,0,0 /home
#then it asks me to press return and I have to do it manually otherwise it doesnt go on

I know it's kind of a dumb question but I'm a newbie.

Hko 10-22-2002 11:22 AM

I don't know about cdbkup, but the following probably helps:

yes '' | cdbkup 0 --label=TEST -s 4 0,0,0 /home

The "yes" command produces a continuous stream of 'y' characters followed by 'enters' by default. When you pipe ( '|' ) this to another command it answer 'y' to all questions the command ('cpbkup' in your case) asks from the standard input ("stdin"). You can have 'yes' output a continuous stream of -say- '#' by using "yes '#' ". Or pass it an empty character ( '' - two single quotes) to pass a endless stream of "enters" to the other command.

Hope this helps.

chupacabra 10-22-2002 12:11 PM

thanks bro, it worked
thank you so much, it's all beautiful now.


All times are GMT -5. The time now is 05:26 AM.