Bug 431350
Summary: | error using date in bash | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | vikram goyal <vikigoyal> |
Component: | bash | Assignee: | Tomas Janousek <tjanouse> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | 8 | CC: | twaugh |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2008-02-04 16:38:04 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
vikram goyal
2008-02-03 09:56:45 UTC
Is there any documentation that would suggest this is a violation of some
standard or something? bash interprets numbers beginning with zero as octal
numbers. The date manpage says that when using the '-' flag, numbers are not
zero-padded.
The following commands work:
> echo $(($(date +'%-y')-1))
> echo $(($(date +'%-m')-1))
May I close this notabug?
You are right. My bad. Sorry for bothering you. I never came to understand the error message as it was not clear enough. But one thing is still unclear, why does it happen when the output is 08 only. The command runs without error if output is less than 08 or ( as far as remember ) above 10, I think. You may of course close the bug except that one issue. Well, 07 is a valid octal number, right? And 10 is not interpreted as octal, obviously. |