Version 7 of true

Updated 2007-01-18 02:16:29

True is a boolean value. It is recognised by expr.

  1. True values are yes, on, true, their unique abbrevations, and non-zero integers,
  2. False values are no, off, false, their unique abbrevations, and the integer 0.

The function string is true returns true if its argument obeys the condition 1. above (and string is false does the opposite).

Unless the -strict flag is passed both string is true "" and string is false "" (i.e., testing the empty string) return 1. This is the case to facilitate entry validation in Tk.

The canonical form for true, like in C, is integer 1. To wit:

 % expr 42==42
 1

1S See also: Boolean, magic names


Category Glossary Category Internals