Rick Engebretson wrote:
My guess is "Environment Variable" means different things when referring to shell programs such as bash or tcsh, or when referring to httpd programs such as Apache.
Not really -- CGI programs get some of their information via environment variables (that's why it's possible to write limited CGI programs in bash using $FOO). Other data (e.g. from POST requests) are sent via stadard input however.
BTW, I also have a working CGI unit ready in http://fjf.gnu.de/misc/cgiprogs.tar.bz2 (which supports both GET and POST requests, and internally uses environment variables and standard input as necessary, of course).
Yes really -- I recalled the young man had posted before on CGI forms. Forms environment variables are different than shell variables. Since then he was more specific.
Actually they are the same. E.g., a CGI program gets passed a variable called GATEWAY_INTERFACE to identify the CGI interface, a variable REQUEST_METHOD to identify the method (GET, POST, PUT), a variable QUERY_STRING (for GET) with the form contents etc.
As I said it's possible to use these variables in shell scripts, and AFAIR Apache distributions contain simple such demo scripts. For more complex tasks and especially POST and PUT, shell scripts are probably not the optimal solution, and even for simple tasks it's probably somewhat harder to get shell scripts secure, but there's no fundamental difference to the nature of the variables. (Which is no surprise since environment variables are the main means, besides "command-line" arguments (which really aren't command-line specific), to pass information to a new process by the OS.)
Frank