GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SHTK_BOOL_CHECK (3)

NAME

shtk_bool_check - Converts a string to a boolean value

CONTENTS

Library
Synopsis
Description
Return Values
Examples
Errors
See Also
History

LIBRARY

shtk_import bool

SYNOPSIS

shtk_bool_check value [error_message]

DESCRIPTION

The shtk_bool_check function takes the string value and returns the corresponding boolean value according to shell conventions.

RETURN VALUES

shtk_bool_check returns 0 for any value representing truth. These include the strings 'yes' and 'true', including any variations in their capitalization, and the integer number '1'.

shtk_bool_check returns 1 for any value representing falsehood. These include the strings 'no' and 'false', including any variations in their capitalization, and the integer number '0'.

EXAMPLES

local verbose=no
# Parse flags to see if verbose mode is enabled and set verbose=yes.

if shtk_bool_check "${verbose}"; then # Print messages. fi

ERRORS

shtk_bool_check prints the error given in error_message and exits the shell with non-zero if the value does not represent a valid boolean value. If error_message is not provided, a default message is printed.

SEE ALSO

shtk(3), shtk_bool(3)

HISTORY

shtk_bool_check first appeared in shtk 1.4.
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.