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?
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?