Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble understanding someth

Status
Not open for further replies.

pavNell

Technical User
Sep 27, 2002
178
US
Having trouble understanding something...

In a while loop, when a condition becomes true, I need to prompt user for some input. I was using the read command but it is ignored. Here's an example:

#!/bin/sh

test_dir=/home/bill/data_dir

find . -name "*.wav" -print | while read line
do
# Start my audio encoder
lame -some_options inputfile outputfile
cp $outputfile $test_dir
test_dir_size=`du -B M $test_dir`

if test $test_dir_size -ge 650
then
echo "Enter a Blank cd"
echo "Hit a key to continue"
read ans
my_function_to_burn_cd # call a function
fi
done

In the example, my "read ans" is ignored. The script just keeps executing. What am I doing wrong?
 
find . -name "*.wav" -print |&
while read -p line
do
.
.
.
done

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top