[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problem with \n and variables in bash script



On Tue, Oct 15, 2002 at 05:27:28PM +0200, I?aki Mart?nez wrote:
> SALIDA=$(diff file1 file2)
> 
> if [ $? == 1 ]
> then
>    echo -e $SALIDA | mail -s variable my_email
>    diff file1 file2 | mail -s directly my_email
> fi
> 
> --------------------------------------------------------------------------------
> 
> Well, when i get the emails, the one with subject "variable" it is in ONE line
> but the one with subject "directly" is display correctly.
> 
> 
> So my question is how to get \n processed with variables.

Quote correctly. Also, you can probably drop the -e.

  echo "$SALIDA"

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: