From: Roland G. <r.g...@xs...> - 2001-07-25 11:42:42
|
gl...@ma... wrote: > I tried the change to the exec in Expect. Didn't help. Well, it helped insofar as you now can spawn pipe commands, right? > Currently I am getting this: > > Reached end of medium for /dev/nrmt1h; Please wait for file closing > Cannot prompt (can't open /dev/tty): No such device or address Hmm, this sounds bad. 'dd' is trying to read a user response via /dev/tty, over which Expect doesn't have control. interconnect() cannot help here, because as long as 'dd' is reading from stdin, it has to open /dev/tty for a user respone. [earlier programs tried to read from stderr, and this even worked, on some systems... :-) ] Workaround: don't pipe directly into 'dd', use an intermediate file and spawn 'dd' separately. Disadvantage: you need enough harddiskspace. Workaround for that: a named pipe: 'rsh ... > named_pipe' and 'dd if=named_pipe of=/dev/tape' That way, 'dd's stdin stays available for user responses. I do hope that 'dd' is then using stdin and not stubbornly trying to open /dev/tty, otherwise you've got a real problem. > expect is catching the "Press RETURN ..." message, and happily changing > tapes, but the > > print $bakupcmdobj "\r"; > > which I do after the tape is ready is evidently failing. Yes, because it goes to stdin and not to /dev/tty. Hope this helps, Roland PS: Starting tomorrow, I'm off for summer vacation for two weeks. |