On Dec 1, 2007 12:19 PM, Nelson Serafica <[EMAIL PROTECTED]> wrote:
>
>
>  I'm using bc and it is ok. The problem is I cannot put a number next to the
> output. I cannot command the echo with "-n parameters". After I get the
> value, I need to put another value next to it which is having an error
>
> if [ $grep2a_1 -eq "1" ];
> then
>         echo -n "$time,"
>         echo "scale=3; $com2_1 / 1000" | bc (If I change this line to echo
> -n "scale=3; $com2_1 / 1000" | bc, it has an error)
> else
>         echo "test"
> fi
>

if [ $grep2a_1 -eq "1" ];
then
        value=`echo "scale=3; $com2_1 / 1000" | bc`
        echo -n "$time,$value"any_text_here_to_append
else
        echo "test"
fi

fooler.
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to