Help for read command 2

Help for read command 2

Post by pacuzi » Mon, 31 Jul 2000 04:00:00



-
Can you help me to solve this problem
I have a function to read input

readCommand() {
Res=""
echo Gimme a value
read Res
echo "exit ok from this function"

Quote:}

If  I resize the window (Terminal Console for Exceed) when the script is
ready to receive the input then
the read fail and the execution exit readCommand function without assign the
input value to Res.

Helpppppppppp!!!
Thanks

 
 
 

Help for read command 2

Post by Eric Amic » Mon, 31 Jul 2000 04:00:00



> readCommand() {
> Res=""
> echo Gimme a value
> read Res
> echo "exit ok from this function"

> }

> If  I resize the window (Terminal Console for Exceed) when the script is
> ready to receive the input then
> the read fail and the execution exit readCommand function without assign the
> input value to Res.

You don't say which shell you're using, but you should be able to ignore the
WINCH signal to get what you want:

readCommand() {
trap "" WINCH
Res=""
echo Gimme a value
read Res
echo "exit ok from this function"

Quote:}

You may need to use the number of the signal instead of its name; if so, you can
get the number from the output of kill -l.

--
Eric Amick
Columbia, MD


 
 
 

1. Help with read command

My script looks like this

#!/bin/ksh
for i in 'ls'
do

while read num rest
do
...
done < $i

done

I want to read every file in the directory.
It works fine with reading the first file in the directory, but it
crashes at the second file with the message:
Can't open file

Help would be great!

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Any UNIX gurus in LA

3. Help for read command

4. RPC Problem

5. Help me with the command Read.

6. Please recommend a network rack that's affordable

7. HELP! read command on digital UNIX - C shell

8. Does XF 3.11 support #9 Motion 771?

9. need to pipe a find or locate command into the rm command....PLEASE help!

10. I/O read error reading from internal cd HELP

11. HELP: "TOP" Command and "SZ" command

12. Help: Program to read from EOR end of last read?