Christof Warlich
2017-10-05 17:22:34 UTC
Hi,
I'm a bit surprised: Can anyone tell why
$ xxx=hiho echo $xxx # xxx is only set for the current command
prints an empty line, while
$ xxx=hiho; echo $xxx; unset xxx # please note the semicolon!
prints
hiho
as expected?
Furthermore, note that these few lines of C code:
#include <stdio.h>
#include <stdlib.h>
int main () {
char *xxx = getenv ("xxx");
if(xxx != NULL) printf("%s\n", xxx);
return 0;
}
_do_ print
hiho
when called either way, i.e like this.:
$ xxx=hiho ./a.out
hiho
and like this:
xxx=hiho; ./a.out; unset xxx
hiho
Thanks for any ideas,
Chris
I'm a bit surprised: Can anyone tell why
$ xxx=hiho echo $xxx # xxx is only set for the current command
prints an empty line, while
$ xxx=hiho; echo $xxx; unset xxx # please note the semicolon!
prints
hiho
as expected?
Furthermore, note that these few lines of C code:
#include <stdio.h>
#include <stdlib.h>
int main () {
char *xxx = getenv ("xxx");
if(xxx != NULL) printf("%s\n", xxx);
return 0;
}
_do_ print
hiho
when called either way, i.e like this.:
$ xxx=hiho ./a.out
hiho
and like this:
xxx=hiho; ./a.out; unset xxx
hiho
Thanks for any ideas,
Chris