Changeset 35166 in project


Ignore:
Timestamp:
02/20/18 00:26:06 (10 months ago)
Author:
kon
Message:

rel 1.1.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/posix-utils

    r21382 r35166  
    1010Miscellaneous Posix related routines.
    1111
     12=== string-trim-eol
     13
     14<procedure>(string-trim-eol STR) -> string</procedure>
     15
     16Removes last instance of the platform dependent EOL character sequence from the
     17{{string}} {{STR}}.
     18
     19=== software-eol-string
     20
     21<constant>software-eol-string</constant>
     22
     23Platform dependent EOL character sequence {{string}}.
     24
     25=== environment-variables->environment-list
     26
     27<procedure>(environment-variables->environment-list EVS) -> (list-of string)</procedure>
     28
     29Returns a list of {{"VAR=VAL"}} from the environment variables association-list
     30{{EVS}}.
     31
    1232=== environment-variable-bound?
    1333
    14 <procedure>(environment-variable-bound? VARNAM)</procedure>
     34<procedure>(environment-variable-bound? VARNAM) -> (or boolean string)</procedure>
    1535
    1636Does the environment variable {{VARNAM}} exist with a non-null value?
     
    1939
    2040<enscript language=scheme>
    21 FOO=1 BAR= csi -R posix-utils
    22 #;1> (environment-variable-bound? "FOO") 
     41FOO=1 BAR= csi -q -R posix-utils
     42#;1> (environment-variable-bound? "FOO")
    2343#t
    2444#;2> (environment-variable-bound? "BAR")
     
    2848=== environment-variable-true?
    2949
    30 <procedure>(environment-variable-true? VARNAM)</procedure>
     50<procedure>(environment-variable-true? VARNAM [TRUE-LIST '("y" "yes" "1")]) -> boolean</procedure>
    3151
    32 Does the environment variable {{VARNAM}} have a value of {{[Yy1]}}?
     52Is the environment variable {{VARNAM}} lowercase value in {{TRUE-LIST}}?
     53
     54{{VARNAM}} is a {{string}}. {{TRUE-LIST}} is a {{(list-of string)}} recognized
     55as true values.
     56
     57<enscript language=scheme>
     58FOO=1 BAR= csi -q -R posix-utils
     59#;1> (environment-variable-true? "FOO")
     60#t
     61#;2> (environment-variable-true? "BAR")
     62#f
     63</enscript>
     64
     65=== register-environment-variable-feature!
     66
     67<procedure>(register-environment-variable-feature! VARNAM) -> (or boolean symbol)</procedure>
     68
     69Registers an existing {{VARNAM}} value as a {{feature}}. Returns {{#f}} or the
     70registered feature {{symbol}}.
     71
     72{{VARNAM}} is a {{string}}.
     73
     74=== get-shell-variable
     75
     76<procedure>(get-shell-variable VARNAM) -> (or boolean string)</procedure>
     77
     78Returns the shell variable {{VARNAM}} value.
     79
     80{{VARNAM}} is a {{string}}.
     81
     82=== shell-variable-bound?
     83
     84<procedure>(shell-variable-bound? VARNAM) -> (or boolean string)</procedure>
     85
     86Does the shell variable {{VARNAM}} exist with a non-null value?
     87
     88{{VARNAM}} is a {{string}}.
     89
     90=== shell-variable-true?
     91
     92<procedure>(shell-variable-true? VARNAM [TRUE-LIST '("y" "yes" "1")]) -> boolean</procedure>
     93
     94Is the shell variable {{VARNAM}} lowercase value in {{TRUE-LIST}}?
     95
     96{{VARNAM}} is a {{string}}. {{TRUE-LIST}} is a {{(list-of string)}} recognized
     97as true values.
     98
     99=== register-shell-variable-feature!
     100
     101<procedure>(register-shell-variable-feature! VARNAM) -> (or boolean symbol)</procedure>
     102
     103Registers an existing {{VARNAM}} value as a {{feature}}. Returns {{#f}} or the
     104registered feature {{symbol}}.
    33105
    34106{{VARNAM}} is a {{string}}.
    35107
    36108<enscript language=scheme>
    37 FOO=1 BAR= csi -R posix-utils
    38 #;1> (environment-variable-true? "FOO")
    39 #t
    40 #;2> (environment-variable-true? "BAR")
    41 #f
     109#;1> (register-shell-variable-feature! "OSTYPE")
     110darwin7 ;ymmv
    42111</enscript>
    43112
     
    50119
    51120
    52 == Examples
    53 
    54 
    55 == Notes
    56 
    57 
    58 == Requirements
    59 
    60 
    61 == Bugs and Limitations
    62 
    63 
    64121== Author
    65122
     
    69126== Version history
    70127
     128; 1.1.0 : Added {{string-trim-eol}} , {{software-eol-string}}, {{environment-variables->environment-list}}, {{register-environment-variable-feature!}}, {{get-shell-variable}}, {{shell-variable-bound?}}, {{shell-variable-true?}}, {{register-shell-variable-feature!}}
    71129; 1.0.0 : Created.
    72130
     
    74132== License
    75133
    76 Copyright (C) 2010 Kon Lovett.  All rights reserved.
     134Copyright (C) 2010-2018 Kon Lovett.  All rights reserved.
    77135
    78136Permission is hereby granted, free of charge, to any person obtaining a
Note: See TracChangeset for help on using the changeset viewer.