10-05-2018
You have a read command at the start of your script and you have a read command inside your loop. Every read command will wait for you to type in a response.
Try replacing the first read with an echo or printf that gives the directions for the data to be entered and let the read command inside the loop be the only command that blocks waiting for data to be entered.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
greetings,
I have a script that is taking input like this:
a
b
c
d
aa
bb
aaa
bbb
ccc
ddd
and formating it to be like this:
a b c d
aa bb
aaa bbb ccc ddd (4 Replies)
Discussion started by: adambot
4 Replies
2. Shell Programming and Scripting
I'm trying to run the logic below but get a `<' is not matched error message when I return a Y or y;
printf "Run this ? : "
read RESP
case $RESP in
Y|y)
cat <<EOF > file
today is Monday
EOF ;;
N|n)
exit 1 ;;
esac
Any ideas? (2 Replies)
Discussion started by: h8mmer
2 Replies
3. Shell Programming and Scripting
i want to get user input like this
please tell which option to chose
1. mango 2. tango 3. rango
if user chooses mango
then it should execute a set of statements and again ask like this
what do you want to do
1.add 2.subtract 3.exit
when i choose exit it should goto my previous... (1 Reply)
Discussion started by: s.deepak
1 Replies
4. Shell Programming and Scripting
i want to get user input like this
please tell which option to chose
1. mango 2. tango 3. rango
if user chooses mango
then it should execute a set of statements and again ask like this
what do you want to do
1.add 2.subtract 3.exit
when i choose exit it should goto my previous menu... (4 Replies)
Discussion started by: s.deepak
4 Replies
5. Shell Programming and Scripting
I was trying to write a simple script which will read a text file and count the number of vowels in the file. My code is given below -
#!/bin/bash
file=$1
v=0
if
then
echo "$0 filename"
exit 1
fi
if
then
echo "$file not a file"
exit 2
fi
while read -n... (14 Replies)
Discussion started by: linux_learner
14 Replies
6. Shell Programming and Scripting
I have the following bash script and it is not accepting the lines
"--"|"--""-")
"--""-"")
while
do
echo "Current Argument is ${1}"
case "$1" in
"--"|"--""-")
echo "Argument is ${1}"
shift # Skip ahead one to the next argument.
... (1 Reply)
Discussion started by: kristinu
1 Replies
7. Shell Programming and Scripting
Using BASH:
$ if -- ::00" ]]; then echo "true"; else echo "false"; fi
false
Mike (5 Replies)
Discussion started by: Michael Stora
5 Replies
8. Shell Programming and Scripting
case "$freq" in
" Hz") low=250; high=550;;
"8 Hz") low=250; high=1000;;
" Hz") low=400; high=1000;;
"63 Hz") low=550; high=1000;;
" Hz") low=400; high=550;;
... (2 Replies)
Discussion started by: Michael Stora
2 Replies
9. Shell Programming and Scripting
Hi Gurus,
I have the below BASH code which does not works for upper case alphabets except Z (upper case Z).
What may be the reason. Also escape sequences like \n, \t, \b, \033(1m \033(0m (For bold letter) are not working.
case $var in
)
echo "Lower case alphabet"
;;
... (7 Replies)
Discussion started by: GaneshAnanth
7 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a script below that is running ssh <host> <command> on some servers.
Below is more or less the script. I have to modify it somehow to get rid of the 'confidential' hostnames
check_log.bash
#!/bin/bash
#
myPID=$$
parse_log ()
{
sub="parse_log"
host=${1}
... (2 Replies)
Discussion started by: newbie_01
2 Replies