bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash man page needs more examples...(i.e. >0)


From: Linda Walsh
Subject: bash man page needs more examples...(i.e. >0)
Date: Sat, 28 Jan 2012 13:05:57 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666

reading the section no constants:
Constants with a leading 0 are interpreted as octal numbers. A leading 0x or 0X denotes hexadecimal. Otherwise, numbers take the form [base#]n, where base is a decimal number between 2 and 64 representing the arithmetic base, and n is a number in that base. If base# is omit- ted, then base 10 is used. The digits greater than 9 are represented by the lowercase letters, the uppercase letters, @, and _, in that order. If base is less than or equal to 36, lowercase and uppercase letters may be used interchangeably to represent numbers between 10 and
      35.

declare -i var
var=0x20; echo $var
32

ok, fine, now lest try decimal, digits > 9 represented by lower case, so
'a' seems like it would be used for base

var=a32 ;echo $var
0
#nope, maybe I have to have a leading 0...
var=0a32; echo $var
-bash: 0a32: value too great for base (error token is "0a32")
#nope, maybe he mean for me to actually use # after
the base...?

var=a#32; echo $var
-bash: a#32: syntax error: invalid arithmetic operator (error token is "#32")

#nep!... Geez, Um, just exactly HOW should one
determine the syntax from the above?

???
thanks (I think? though a few examples would be nice in several areas...)...






reply via email to

[Prev in Thread] Current Thread [Next in Thread]