![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script answer prompts? | eltinator | Shell Programming and Scripting | 4 | 08-29-2007 11:15 AM |
| UNIX Auto-login | nvanduyne | UNIX for Advanced & Expert Users | 1 | 06-15-2006 10:16 AM |
| Auto FTP from UNIX to Windows Server | songtam | High Level Programming | 1 | 04-07-2006 07:26 AM |
| Auto Alias Script | coolboarderguy | Shell Programming and Scripting | 3 | 12-25-2005 09:11 AM |
| the unix answer to SSI? | garrettcarr | UNIX for Dummies Questions & Answers | 1 | 09-09-2002 11:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Auto answer ( Yes or No) from unix script
Dear All,
I have a backup script (in Unix), when executing the script need to give some answers. eg - Do you want to backup - y Like this i have to give Y and N for several questions. So i want a script when executing this backup script to give Y and N automatically. Help me to do this. Thanks. Nayanajith. |
|
||||
|
Is this the sort of case construct you are looking for?
Code:
echo "\n\n Would you like to say yes (y/n)?"
read YN
#
case $YN in
[yY]*) echo do something
;;
[nN]*) echo "Good. Bye for now.\n"
exit 0
;;
esac
|
|
||||
|
Quote:
When back up script is running it is asking some questions.so i want to escape from those question.What i mean is i wanted to answer those questions automatically by another scripts.( I can not modify the original backup script..thats why) Help me. Nayanajith. |
|
||||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|