Glenn, using export _AST_FEATURES=value to change getconf UNIVERSE only works per process, but does not affect built ins. I made 2 examples to demonstrate this:
The example should print "bsd" and "att" but it does not work because _AST_FEATURES is only probed at process start up: ksh -c 'builtin getconf ; _AST_FEATURES="UNIVERSE = bsd" getconf UNIVERSE ; _AST_FEATURES="UNIVERSE = att" getconf UNIVERSE' att att The next example should print identical lines from sum running in bsd mode, but it does not work because changing _AST_FEATURES in a ksh shell does not work: (_AST_FEATURES="UNIVERSE = bsd" ksh -c 'builtin sum ; sum /bin/ls') 64862 100 /bin/ls (ksh -c 'export _AST_FEATURES="UNIVERSE = bsd" ; builtin sum ; sum /bin/ls') 48495 200 /bin/ls Glenn, can you try to change this that changing an exported _AST_FEATURES will affect the next built in, please? Olga On Mon, Apr 16, 2012 at 9:46 AM, Glenn Fowler <[email protected]> wrote: > > see (ast) getconf --man > in particular > -w, --writable Display the named writable variables in name=value form. > If name is omitted then all writable variables are listed. > and the ENVIRONMENT section for process and descendant local values via > _AST_FEATURES > > it is preferable to change the writeable values via getconf(1) > but my default .profile has > _AST_FEATURES="UNIVERSE = att PATH_RESOLVE - logical" > export _AST_FEATURES > which works even if the login shell is not ksh (ast getconf(1) is a ksh > builtin) > > setting UNIVERSE may influence more than you want > e.g., it controls default echo(1) behavior > you have to check individual --man to see all of the affected utilities > > On Mon, 16 Apr 2012 02:27:53 +0200 Henk Langeveld wrote: >> ольга крыжановская: >> > Henk, can I control getconf UNIVERSE from an environment variable? > >> I don't think so. getconf(1) is a cli built on top of the astgetconf(3) >> interface that in turn wraps the pathconf(2) and sysinfo(2) system calls. > >> Some getconf variables may be changed for the current process and its >> descendants: > >> HQ:/home/Henk 526 # getconf UNIVERSE >> att >> HQ:/home/Henk 527 # getconf UNIVERSE = bsd >> HQ:/home/Henk 528 # getconf UNIVERSE >> bsd >> HQ:/home/Henk 529 # echo abc | sum >> 8288 1 >> HQ:/home/Henk 530 # getconf UNIVERSE = att >> HQ:/home/Henk 531 # echo abc | sum >> 304 1 >> HQ:/home/Henk 532 # > >> _______________________________________________ >> ast-users mailing list >> [email protected] >> https://mailman.research.att.com/mailman/listinfo/ast-users > -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----'-/`-/ [email protected] \-`\-'----. `'-..-| / http://twitter.com/fleyta \ |-..-'` /\/\ Solaris/BSD//C/C++ programmer /\/\ `--` `--` _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
