ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Mikhail Zabaluev <mhz@alt-linux.org>
To: "\"Баталов Григорий\"" <mandrake-russian@altlinux.ru>
Subject: [mdk-re] Re: bash
Date: Mon Feb 11 12:26:14 2002
Message-ID: <20020211093116.GA29567@mhz.mikhail.zabaluev.name> (raw)
In-Reply-To: <06807842.20020208114512@beep.ru>

Hello Vladimir,

On Fri, Feb 08, 2002 at 11:45:12AM +0300, Vladimir Karpinsky wrote:
>
> >> [user@host:~]$ echo $((07+1))
> >> 8
> >> [user@host:~]$ echo $((08+1))
> >> bash: 08: value too great for base (error token is "08")
> >> 
> >> Аналогично и для 09. Чем эти 08 и 09 принципиально отличаются от
> >> 01..07? Как с эти бороться?
> 
> БГ>    Восьмиричная система счисления? Это, видимо, от того, что
> БГ>  ноль впереди.
> 
> Нет система десятичная, 0 вылезает, поскольку в реальной жизни там
> стоит $((`date +%d`)). До сегодняшнего дня (с середины января) все
> работало, а вот сегодня выдало ошибку. Я сначала вообще не мог понять
> о чем это, поскольку строка длинная была, но потом удалось проблему
> сузить.

Числа, начинающиеся с 0, интерпретируются как восьмиричные.
Так что придётся либо найти формат, который не рисует 0 спереди, либо
не использовать вывод date в арифметике bash. В perl и python со
временем работать намного приятнее.

-- 
Stay tuned,
  MhZ                                     JID: mookid@jabber.org
___________
Boys, you have ALL been selected to LEAVE th' PLANET in 15 minutes!!



  reply	other threads:[~2002-02-11 12:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-08 11:22 [mdk-re] bash Vladimir Karpinsky
2002-02-08 11:30 ` "Баталов Григорий"
2002-02-08 11:40   ` Re[2]: " Vladimir Karpinsky
2002-02-11 12:26     ` Mikhail Zabaluev [this message]
2002-02-08 11:39 ` Alexander E. Syasin
2002-02-08 12:05   ` Re[2]: " Vladimir Karpinsky
2002-02-08 12:15     ` Eugene Pazhitnov
2002-02-08 22:29       ` Re[4]: " Vladimir Karpinsky
2002-02-08 13:08     ` Re[2]: " Eugene Pazhitnov
2002-02-09 19:58       ` [mdk-re] Re: bash; date Michael Shigorin
2002-02-09 22:59         ` Vladimir Karpinsky
2002-02-08 11:41 ` [mdk-re] bash Andrew Borodin

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=20020211093116.GA29567@mhz.mikhail.zabaluev.name \
    --to=mhz@alt-linux.org \
    --cc=mandrake-russian@altlinux.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

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

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


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