> Quoth Veljko on Sunday, 20 March 2011:
> > On Sun, Mar 20, 2011 at 05:52:39PM +0100, Christian Ebert wrote:
> > > I don't know VLC and what it accepts as arguments, but with
> > > mplayer this works at the Mutt pipe-entry prompt:
> > > 
> > > mplayer -
> > > 
> > > or
> > > 
> > > mplayer /dev/stdin
> > > 
> > > Find out if and how VLC accepts standard input as an argument.
> > 
> > Tried with mplayer and the result is:
> > Playing /dev/stdin.
> > Cannot seek backward in linear streams!
> > Seek failed
> > 
> > or
> > 
> > Playing -.
> > Reading from stdin...
> > Cannot seek backward in linear streams!
> > Seek failed
> > 
> > > > But it doesn't really matter. I was just being curious about it. :-)
> > > 
> > > In practice you would use pipe-message and pipe-entry for text
> > > content mainly I would think.
> > > 
> > > c
> > 
> > Yeah, I guess you are right, not really intended to be used with
> > multimedia.
 
 Here's a little script I use to move stdin to a file argument:
 
 --------
 #!/bin/sh
 needsterm=false
 while getopts th o; do
   case "$o" in
   t)   needsterm=true;;
   h)   echo >&2 "Usage: $0 [-t] cmd"
        exit 1;;
   esac
 done
 shift `expr $OPTIND - 1`
 file=`mktemp /tmp/farg.XXXXXX`
 cat > $file
 if $needsterm; then
   `printf "$*" $file` < /dev/tty
 else
   `printf "$*" $file`
 fi
 rm $file
 --------
 
 I call it 'farg'.
 
 Now you can use mutt's pipe command for any command that accepts a file
 argument:
 
 |farg 'mplayer %s'
 
 for commands that want stdin to be the terminal, add -t:
 
 |farg -t 'vim %s'
 
 -- 
 Sterling (Chip) Camden | [email protected] | 2048D/3A978E4F
 http://chipsquips.com  | http://camdensoftware.com   | http://chipstips.com

-- 
Sterling (Chip) Camden | [email protected] | 2048D/3A978E4F
http://chipsquips.com  | http://camdensoftware.com   | http://chipstips.com

Attachment: pgpui6HtmK0tE.pgp
Description: PGP signature

Reply via email to