bug-bash
[Top][All Lists]
Advanced

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

Re: Precedence of "C operators" and "bash operators"


From: Eric Blake
Subject: Re: Precedence of "C operators" and "bash operators"
Date: Sat, 18 Dec 2010 20:13:51 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 12/18/2010 09:22 AM, 12bric wrote:
> 
> Bash 4-1 manual indicates 
>      - "The operators and their precedence, associativity, and values are
> the same as in the C language" (pp. 27).
>      - the precedence of - and + operators is different then the precedence
> of ! and ~.
> 
> But in the book "C a reference manual" (Harbison & Steele), the four
> operators + - ! ~ have the same precedence.

The unary operators + and - have the same precedence as the unary ! and
~; and that level of precedence is higher than that of the binary + and -.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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