Saratov Linux User Group
 help / color / mirror / Atom feed
From: Aleksei Sinitsyn <a.sinitsin@gmail.com>
To: Saratov Linux User Group Maillist <sarlug@lists.lug.ru>
Subject: Re: [Sarlug] Распарсить CSV
Date: Mon, 10 Dec 2012 14:22:33 +0300
Message-ID: <CAF_a_DNSQk7rt-EfrJEwin5YtWz90QcEapcign26U0_dY70aHA@mail.gmail.com> (raw)
In-Reply-To: <CANXqFx_UP5ZUR-9sd+_N+JpnC3ASiDMzLXF7_u9G_Mp6aS_L8Q@mail.gmail.com>

10 декабря 2012 г., 13:04 пользователь Тарас Перебейносов
<taras.perebeynosov@gmail.com> написал:
> 2 нубских вопроса:
> 1) как мне в if сравнивать дробные числа?
> 2) как можно округлить до integer?
>

 Если до этого считать с помощью bc то можно убрать ключ -l . Без него
bc считает целочисленно

> storage=144388915.2; if [ $storage -lt "5242880" ];then echo yes;else echo
> no;fi
> bash: [: 144388915.2: integer expression expected
>
> 2012/12/3 Дмитрий Бурмистров <demon@nita-farm.ru>
>>
>> awk '{print $3}' | sed 's\KB\*1024\' |
>> sed 's\MB\*1024*1024\' | bc -l
>

-- 
WBR, sinaps.    http://saratov.lug.ru
JID:sinaps@jabber.org   gtalk:a.sinitsin

      parent reply	other threads:[~2012-12-10 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03  8:02       ` Aleksei Sinitsyn
2012-12-03  8:56             ` Дмитрий Бурмистров
2012-12-03  9:37                 ` Aleksei Sinitsyn
2012-12-10 11:22                     ` Aleksei Sinitsyn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAF_a_DNSQk7rt-EfrJEwin5YtWz90QcEapcign26U0_dY70aHA@mail.gmail.com \
    --to=a.sinitsin@gmail.com \
    --cc=sarlug@lists.lug.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Saratov Linux User Group

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sarlug/0 sarlug/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sarlug sarlug/ http://lore.altlinux.org/sarlug \
		sarlug@lists.lug.ru sarlug@lug.ru
	public-inbox-index sarlug

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sarlug


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git