Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-16
23:34 • Ticket [218160ffff] expr fails status still Closed with 3 other changes artifact: b1a819bf87 user: dgp
2000-10-26
08:15 • Closed ticket [218160ffff]. artifact: a74204984b user: welch
00:53 • New ticket [218160ffff]. artifact: 56ae7c53e7 user: nobody

expr fails

Closed / Fixed218160ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:56
OriginalBugID: 2194 Bug
Version: 8.0.4
SubmitDate: '1999-06-07'
LastModified: '1999-08-08'
Severity: LOW
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: 2.6
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-08-08'


Name:
steve szabo

Extensions:
none

CustomShell:
none

ReproducibleScript:
safina $ tcl
    tcl> puts [ expr 00 + 1 ]
    1
    tcl> puts [ expr 01 + 1 ]
    2
    tcl> puts [ expr 02 + 1 ]
    3
    tcl> puts [ expr 03 + 1 ]
    4
    tcl> puts [ expr 04 + 1 ]
    5
    tcl> puts [ expr 05 + 1 ]
    6
    tcl> puts [ expr 06 + 1 ]
    7
    tcl> puts [ expr 07 + 1 ]
    8
    tcl> puts [ expr 08 + 1 ]
    Error: syntax error in expression "08 + 1"
    tcl> puts [ expr 09 + 1 ]
    Error: syntax error in expression "09 + 1"
    tcl> puts [ expr 10 + 1 ]
    11
    tcl> puts [ expr 11 + 1 ]
    12
    tcl> puts [ expr 12 + 1 ] 
    13
    tcl> puts [ expr 13 + 1 ]
    14

ObservedBehavior:
expr dies on 08 + 1 or 09 + 1



As specified in the expr man page, numbers beginning with 0
are interpreted as octal, for which 08 and 09 are invalid. 
-- 08/08/1999 hobbs
welch Closed ticket [218160ffff]. [History diff]2000-10-26 08:15:57
dgp Ticket [218160ffff]: 3 changes [History diff]2001-04-16 23:34:37
Log in (anonymous is fine) to add a comment.