Thread View: comp.unix.shell
3 messages
3 total messages
Started by Bob Debula
Tue, 18 Sep 1990 15:19
pipes and stdin (want keyboard back)
Author: Bob Debula
Date: Tue, 18 Sep 1990 15:19
Date: Tue, 18 Sep 1990 15:19
21 lines
1264 bytes
1264 bytes
I have a script that I'm trying to use in conjunction with "rn". Basically, "rn" allows you to save (with "s") a news article to a pipe. I thought I would be able to do something like: s | fnews Unfortunately, I want to take input from the keyboard later in the fnews script (I immediately cat the new article text to a temporary file). My understanding is that the in piping to "fnews", the file descriptor (0) for stdin has been reassigned to the pipe. Is there any relatively straight-forward way to get it back to the keyboard? My apologies if this is a simple or much discussed problem (I haven't been able to find anything on it in several "UNIX guru" type books). Thanks for any help you may be able to give. (By the way, I'm using the Korn shell, but I suppose the answer would probably apply to Bourne as well).
Re: pipes and stdin (want keyboard back)
Author: Michael Meissner
Date: Tue, 18 Sep 1990 17:25
Date: Tue, 18 Sep 1990 17:25
32 lines
1758 bytes
1758 bytes
In article <4753@nisca.ircc.ohio-state.edu> bobd@nisca.ircc.ohio-state.edu (Bob Debula) writes: | I have a script that I'm trying to use in conjunction | with "rn". Basically, "rn" allows you to save (with "s") | a news article to a pipe. I thought I would be able to do | something like: | | s | fnews | | Unfortunately, I want to take input from the keyboard | later in the fnews script (I immediately cat the | new article text to a temporary file). My understanding | is that the in piping to "fnews", the file descriptor (0) | for stdin has been reassigned to the pipe. Is there | any relatively straight-forward way to get it back to | the keyboard? My apologies if this is a simple | or much discussed problem (I haven't been able to find | anything on it in several "UNIX guru" type books). | Thanks for any help you may be able to give. | | (By the way, I'm using the Korn shell, but I suppose | the answer would probably apply to Bourne as well). Use the following: s | cat /dev/tty - | fnews -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Do apple growers tell their kids money doesn't grow on bushes?
Re: pipes and stdin (want keyboard back)
Author: Rich Salz
Date: Tue, 18 Sep 1990 19:29
Date: Tue, 18 Sep 1990 19:29
13 lines
938 bytes
938 bytes
In article <4753@nisca.ircc.ohio-state.edu> bobd@nisca.ircc.ohio-state.edu (Bob Debula) writes that when doing s|fnews inside rn, the article is on stdin, and later he needs to read the keyboard. Open up /dev/tty: cat >/tmp/article$$ trap "exec rm -f /tmp/article" 0 1 2 3 15 exec </dev/tty .... -- Please send comp.sources.unix-related mail to rsalz@uunet.uu.net. Use a domain-based address or give alternate paths, or you may lose out.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads