[mdlug] UNIX tips: Learn 10 good UNIX usage habits

Michael Corral micorral at comcast.net
Wed Mar 12 04:23:33 EDT 2008


2008-03-12, Monsieur Raymond McLaughlin a ecrit:
> In this vein, this command:
>  w3m mdlug.org/contacts/president/scripts+scraps/home/.bashrc
> will send the file to standard output, but
>  w3m mdlug.org/contacts/president/scripts+scraps/home/.bashrc |source -
> will not source this stdout.
> It seems there should be a way to do this just using pipes, but I
> haven't been able to do it without writing to a local file first.

See my previous post with the example of how using a pipe can sometimes
give unexpected results in bash. You could probably use coprocesses to
do the trick, but bash doesn't have those yet, IIRC (ksh93 does, though).

Even if you do my 'x=a; echo "b"|read x; echo $x' example in bash and
then in zsh, you'll see the difference.

Michael



More information about the mdlug mailing list