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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sleep and wait question

Status
Not open for further replies.

segment

ISP
Jun 15, 2004
225
US
I have a question on sleep and wait... I have a script that will do something like this:

find . -type d -maxdepth 1 |grep -v "\.$"|head -n2|while read DIR
do \
echo "cd $DIR"
(cd $DIR
ls -1 *.files |while read i; do echo i ; done
echo -e "just finished $DIR place other something\nand hit enter")
done

I need it to wait until I give it input after echo -e "just finished......", not sleep but sit there and wait. Any help on this?
 
In your shell man page pay attention to the read builtin.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
read -p "just finished $DIR place other somethingand hit enter " junk

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks but it didn't work. Here is the full script

#!/bin/sh
IFS=|\
find . -type d -maxdepth 1 |grep -v "\.$"|head -n2|while read DIR
do \
echo "cd $DIR"
(cd $DIR
mkdir wavs
ls -1 *.mp3 |while read i; do mpg123 -s "$i" | sox -t raw -r 44100 -s -w -c2 - wavs/`echo $i |sed 's/\.mp3
/\.wav/g'`; done
cdrecord -dummy -eject dev=0,0,0 speed=12 -pad -audio wavs/*
rm -rf wavs
read -p "just finished $DIR, put in another cd asshole\nand hit enter")
done

(note the read -p) didn't work. Maybe I just need some sleep of my own to figure it out... Has me a bit bonked
 
#!/bin/ksh

there's no 'read -p' in Bourne.

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
And this ?
echo "just finished $DIR, put in another cd asshole\nand hit enter"; read junk </dev/tty)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
thanks for the tips... Guess I'll play with it a bit. It's skipping the read even though set -x has it running or something
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top