LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Bash function (http://www.linuxquestions.org/questions/linux-software-2/bash-function-299091/)

pazvant 03-08-2005 07:06 AM

Bash function
 
Hi guys,

I have a program in bash. When a start this programme it wants me to hit ENTER key to continue.
I call this programme in my other bash script and gives << ENTER , however
it works but the bash programme did not go below line like ==
.....
..............
/home/backup/upgrade_export $DIR << ENTER ==>After this works program exit !!


echo " TEST TEST" > TEST

hanzerik 03-08-2005 07:47 AM

Example:

Code:

#!/bin/bash
echo "This is a simple bash script to use the read function"
echo "Press Enter to Continue"
# Blank read to just pause the script, while you do something
read
echo "Please Enter Your name"
read NAME
echo "Please enter your age"
read AGE
echo "So Now we have your name: $NAME and age: $AGE"
echo "Calling a different program...say ping"
echo "Enter a IP Address"
read IP
ping -c 1 $IP
echo "The script read your input and directs it to the ping command."
echo "$NAME this has been a simple example of using read in a bash script"

Not sure if this helps you or not, as I don't know what the bash programs you use are doing. But you should be able to call other programs from a script and have it continue on after that program has finished what it was doing.


All times are GMT -5. The time now is 02:48 AM.