Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Oct 2014 19:18:29 -0500
From:      "William A. Mahaffey III" <wam@hiwaay.net>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: sh man page ....
Message-ID:  <54387755.8020707@hiwaay.net>
In-Reply-To: <20141010105249.23b25ada@mizar.holyordnance.org>
References:  <5437FB8B.9080008@hiwaay.net> <CAHu1Y70u6FSwYDnA0KBctWKjJrTWrYrn82eqO_UBX2L30H2Vnw@mail.gmail.com> <5437FE3D.8070808@hiwaay.net> <20141010105249.23b25ada@mizar.holyordnance.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/10/14 11:52, Eric S Pulley wrote:
>> Well !!!! The sh man page is mute on the fact that an empty string is
>> an error in arithmetic or logical evaluations, which is an omission
>> irrespective of what bash does :-). I presume that converting Linux
>> users to FBSD users is an agenda item here (maybe my error), thus
>> suitably complete man pages should be an important goal, I would
>> think. I didn't think converting from Linux to FBSD was/is a bad
>> habit ;-) ....
>>
>>
> I'm confused, can you ever do arithmetic or logical evaluations on an
> empty string?... Why have an entry stating the obvious? If all man
> pages did is state the obvious there wouldn't be room for the important
> stuff. And then even less people would bother to read them.
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>


For better or worse, bash does exactly that (do arithmetic or logical 
evaluations on empty strings), evaluating the empty string to zero (0) 
.... I didn't write bash, but it is out there, widely used, & thus it is 
quite possible for someone to accidentally (my case) or otherwise run 
into &/or expect that behavior .... Given that, it doesn't seem at all 
out of line to expect that the sh man page might just mention that in 
passing. IIRC, my old SGI's sh man pages did mention that ....


-- 

	William A. Mahaffey III

  ----------------------------------------------------------------------

	"The M1 Garand is without doubt the finest implement of war
	 ever devised by man."
                            -- Gen. George S. Patton Jr.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54387755.8020707>