Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-22-2002, 10:57 AM   #1
Registered: Oct 2002
Posts: 30

Rep: Reputation: 15
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.
Old 10-22-2002, 11:22 AM   #2
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
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.
Old 10-22-2002, 12:11 PM   #3
Registered: Oct 2002
Posts: 30

Original Poster
Rep: Reputation: 15
Talking thanks bro, it worked

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
can a C function return value to Shell Script variable yarnar Programming 17 06-02-2010 05:54 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM
return value from shell script to c code? khucinx Programming 1 05-13-2004 03:43 PM
GNU wget return codes for shell script greenhornet Programming 3 05-09-2004 07:51 PM
Space Key in Shell Script joshlamerritt Linux - General 1 02-20-2004 01:31 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:47 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration