Index: [thread] [date] [author] [stats]
  From: Alberto González Palomo <alberto@matracas.org>
  To  : Sebastian M. Alvarez <sebastianmalvarez@gmail.com>
  Date: Sat, 23 Apr 2011 12:16:30 +0200

Re: [masqmail] Pipe route

Sebastian M. Alvarez wrote: (22/04/11 21:20)
>[...]
> The bash script:
> ***
> #!/bin/bash
> mail=($(<  /dev/stdin))
> echo $mail>>  /tmp/testlog
> exit
> ***
>
> Now, it works, but I the file '/tmp/testlog' only prints:
> ***
> aseba@tomahawk:~$ cat /tmp/testlog
> Received:
> Received:
> ***
>
> Any idea why? what am I missing?

     Just remove the outer parentheses:

mail=$(< /dev/stdin)

     Otherwise the string is parsed and only the first word is taken.

     I guess you know that $() is the same as the more usual ``:

mail=`< /dev/stdin`

http://www.gnu.org/software/bash/manual/bashref.html#Command-Substitution

     Cheers,
-- 
	Alberto González Palomo
	Toledo, España / Saarbrücken, Deutschland
	http://www.matracas.org


Index: [thread] [date] [author] [stats]