--- [EMAIL PROTECTED] wrote:
> Send PLUG mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.linux.org.ph/mailman/listinfo/plug
> or, via email, send a message with subject or body 'help'
> to
> [EMAIL PROTECTED]
>
> 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
You can try using "xargs" command
echo "scale=3; $com3_1/1000" |bc | xargs echo -n
Or if you need to manipulate the result returned by bc, you
can direct the output to a variable by enclosing the whole
command it under a pair of backticks (`)
var=`echo "scale=3; $com2_1/1000" | bc`
echo $var
ludwig
____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
_________________________________________________
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