FAQ Database Discussion Community


How to initialise an Ada Unbounded String from GetEnv & Literal

string,ada,getenv
G'day, I'm finding compile errors on what ought to be a simple piece of code. the objective is to use an environment variable as part of a default value. We are using Ada95, so I wondered if it's a version thing. The 'model' we stated with looks (something) like this:...

Environment variable $QUERY_STRING is not being included with *envp[]

c,linux,raspberry-pi,environment-variables,getenv
I have set an environment variable with the following command: QUERY_STRING='This is my query string' This is my program: #include <stdio.h> #include <stdlib.h> void main (int argc, char *argv[]) { printf("%s\n", getenv("QUERY_STRING")); } And this is what I get when I run the program: [email protected] /testing/cgi_download/temp $ echo $QUERY_STRING; ./a.out...

PHP getenv() returning only few parameters in Windows

php,apache,mod-fcgid,getenv
I recently changed the webserver environment on my production system to Apache2.4/mod_fcgid 2.3.9. On restarting Apache, I realized that my scripts depending on the PHP getenv() were broken. Checking further, I could retrieve the Windows PATH with getenv("PATH") but not several other variables set by my application installation, or even...

getenv(“HOME”) returns “/root” with “sudo”

c++,raspberry-pi,root,sudo,getenv
I'm writing a program on my Raspberry Pi that requires the function "getenv("HOME")" to locate "/home/pi". However, since I'm using the "wiringPi" library that requires "sudo" to run, "getenv("HOME")" now returns "/root" as the HOME directory instead of "/home/pi". Is there a way to locate "/home/pi" with "getenv("HOME")" while using...