Thank you ! I think I now understand, more or less, why it does not work as expected. Perhaps my question is more about Linux, than about Mutt. What I really want to achieve is the following:
echo "mydata" | myscript.sh where myscript.sh is the following: #!/bin/bash some-program-which-reads-from-stdin.sh mutt In other words, the script first reads the pipe and does something, and then just calls mutt. Somehow, beteween ``some-program-...'' and ``mutt'' I have to insert some command, saying: ``finished reading pipe, control is now returning to the terminal'' Is that possible? Is it possible to call Mutt from within scripts accepting pipe input? On Tue, Apr 17, 2012 at 10:37:55AM -0500, Derek Martin wrote: > On Tue, Apr 17, 2012 at 11:46:15AM -0300, Andrei Mikhailov wrote: > > I would expect that this command: > > > > echo mymaildir | xargs mutt -f > > > > be equivalent to: > > > > mutt -f mymaildir > > > > But instead, mutt complains about ``no recipient specified''. > > Please help me to figure this out! > > The problem here is that when you run it this way, Mutt's stdin is not > a terminal. When that's the case, mutt expects you're composing a > message on the command line, and will complain when you don't provide > it enough options to specify the message envelope: > > $ mutt -f Mailbox < /dev/null > No recipients were specified. > > For the UI to work, stdin must be a terminal, so that mutt (or rather, > whichever terminal control library it uses) knows what to send to the > terminal to draw the screen, etc. AFAIK there's no way around that. > > -- > Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 > -=-=-=-=- > This message is posted from an invalid address. Replying to it will result in > undeliverable mail due to spam prevention. Sorry for the inconvenience. >