Sponsored Content
Full Discussion: environmental varibles
Top Forums UNIX for Dummies Questions & Answers environmental varibles Post 4425 by Xiix on Tuesday 24th of July 2001 05:09:52 PM
Old 07-24-2001
environmental varibles

flavor -- AIX 4.2.1

I am putting together some HTML pages, some of which contain forms. The problem pops up when I attempt to pass variables (from the forms) from one HTML page to a cgi-like page created using ksh.

I have used the $1 - $9 vars, but they do not work with the passing. With Perl I have done something close to this using $ENV.

The HTML tags (html, body, form . . .) all work within the ksh script, and I can echo new data into the page that the script creates, but I just can't get the form data from one page to pass to my ksh script.

My eye are weary from searching for the answer via uncountable web searches.

Thanks in advance guys and gals. . .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic Varibles problem

All, Any chance someone could help me with this.... The script is reading from a file and for every line of input to the loop I am trying to assign a new varible. When i run the script I get the below errors. I have come to a bit of a dead end so any pointers/help would be very much... (1 Reply)
Discussion started by: oconnon2
1 Replies

2. UNIX for Dummies Questions & Answers

different way to echo varibles...help

Given the following loop: foreach id (DB4 GH4 CD4) and the previously defined variables: DB4sf DB4sfk DB4pp GH4sf GH4sfk GH4pp CD4sf CD4sfk CD4pp how do i echo all of these variables using a one line command in the for loop. If it was a script, and assuming the previously mentioned... (8 Replies)
Discussion started by: wxornot
8 Replies

3. Shell Programming and Scripting

Environmental Variable

Hi, I'm exporting an environmental variable from a C program using putenv function. I'm calling the exe of the C program from shell script. But when I display the environmental variables from the Shell script, My varaible is not getting displayed. Can anyone please tell me how to get it in... (2 Replies)
Discussion started by: janemary.a
2 Replies

4. UNIX for Dummies Questions & Answers

How to create ENV varibles

Hi, I want create env variable for "/ramakrsihna/scripts" help me on this. (1 Reply)
Discussion started by: koti_rama
1 Replies

5. Shell Programming and Scripting

split varibles and store fields into shell varible array

I need to split a long varible which is a whole line read from a file into fields and store them in an array, the fields are delimited by pipe and a field may contain white spaces. I tried the following concept test and it has problem with field 5 which contain a space, appearently so because... (3 Replies)
Discussion started by: gratus
3 Replies

6. AIX

Environmental Problem

HI ALL, I invoked this command "errpt -a | more " then I got tis message in the server LABEL: EPOW_SUS_CHRP IDENTIFIER: BE0A03E5 Date/Time: Thu Apr 10 19:37:57 SAUS Sequence Number: 9038 Machine Id: 003AFDBC4C00 Node Id: jbvrprd Class: H... (1 Reply)
Discussion started by: magasem
1 Replies

7. Shell Programming and Scripting

Multiple varibles in file

Working on a way to speed up my script output. I have a multiline file that I pull each line as a variable and post it on a webpage. It needs some help as it works but slow. I think I have too many cat, grep and sed going on but don't know what would work better. #!/bin/sh... (5 Replies)
Discussion started by: numele
5 Replies

8. Shell Programming and Scripting

Passing varibles as a string argument ?

For example test.sh: test="teststring" cmd=$1 $cmd For some reason I'm NOT seeing "teststring" when I type: ./test.sh "echo $test" Any ideas on how to get around this? I've tried commands like: ./test.sh "echo $($test)" ./test.sh "echo '$test'" And many variations to no... (6 Replies)
Discussion started by: secops
6 Replies

9. UNIX for Advanced & Expert Users

Environmental variable

i want to set environmental variables in solaris and redhat. it should show the current directory and the default shell should be bourne shell. along with it should show the hostname.. like this hostname{/home/vipin/data}# ifconfig Thanks in advanced.:wall: Please use code tags.... (1 Reply)
Discussion started by: vipinkumarr89
1 Replies

10. UNIX for Dummies Questions & Answers

Need Help Setting Path and Environment Varibles

Hello all, I have a Mac OS X (10.7), and I need to set environment variables and paths for some programs I will be running. I have followed instructions and searched the Web for where to do this, but I can't seem to find an answer. I have tried using the VIM editor to write them into my .login,... (2 Replies)
Discussion started by: Tyler_92
2 Replies
SSI(3pm)						User Contributed Perl Documentation						  SSI(3pm)

NAME
CGI::SSI - Use SSI from CGI scripts SYNOPSIS
# autotie STDOUT or any other open filehandle use CGI::SSI (autotie => 'STDOUT'); print $shtml; # browser sees resulting HTML # or tie it yourself to any open filehandle use CGI::SSI; open(FILE,'+>'.$html_file) or die $!; $ssi = tie(*FILE, 'CGI::SSI', filehandle => 'FILE'); print FILE $shtml; # HTML arrives in the file # or use the object-oriented interface use CGI::SSI; $ssi = CGI::SSI->new(); $ssi->if('"$varname" =~ /^foo/'); $html .= $ssi->process($shtml); $ssi->else(); $html .= $ssi->include(file => $filename); $ssi->endif(); print $ssi->exec(cgi => $url); print $ssi->flastmod(file => $filename); # # or roll your own favorite flavor of SSI # package CGI::SSI::MySSI; use CGI::SSI; @CGI::SSI::MySSI::ISA = qw(CGI::SSI); sub include { my($self,$type,$file_or_url) = @_; # my idea of include goes something like this... return $html; } 1; __END__ # # or use .htaccess to include all files in a dir # # in .htaccess Action cgi-ssi /cgi-bin/ssi/process.cgi <FilesMatch ".shtml"> SetHandler cgi-ssi </FilesMatch> # in /cgi-bin/ssi/process.cgi #!/usr/local/bin/perl use CGI::SSI; CGI::SSI->handler(); __END__ DESCRIPTION
CGI::SSI is meant to be used as an easy way to filter shtml through CGI scripts in a loose imitation of Apache's mod_include. If you're using Apache, you may want to use either mod_include or the Apache::SSI module instead of CGI::SSI. Limitations in a CGI script's knowledge of how the server behaves make some SSI directives impossible to imitate from a CGI script. Most of the time, you'll simply want to filter shtml through STDOUT or some other open filehandle. "autotie" is available for STDOUT, but in general, you'll want to tie other filehandles yourself: $ssi = tie(*FH, 'CGI::SSI', filehandle => 'FH'); print FH $shtml; Note that you'll need to pass the name of the filehandle to "tie()" as a named parameter. Other named parameters are possible, as detailed below. These parameters are the same as those passed to the "new()" method. However, "new()" will not tie a filehandle for you. CGI::SSI has it's own flavor of SSI. Test expressions are Perlish. You may create and use multiple CGI::SSI objects; they will not step on each others' variables. Object-Oriented methods use the same general format so as to imitate SSI directives: <!--#include virtual="/foo/bar.footer" --> would be $ssi->include(virtual => '/foo/bar.footer'); likewise, <!--#exec cgi="/cgi-bin/foo.cgi" --> would be $ssi->exec(cgi => '/cgi-bin/foo.cgi'); Usually, if there's no chance for ambiguity, the first argument may be left out: <!--#echo var="var_name" --> could be either $ssi->echo(var => 'var_name'); or $ssi->echo('var_name'); Likewise, $ssi->set(var => $varname, value => $value) is the same as $ssi->set($varname => $value) $ssi->new([%args]) Creates a new CGI::SSI object. The following are valid (optional) arguments: DOCUMENT_URI => $doc_uri, DOCUMENT_NAME => $doc_name, DOCUMENT_ROOT => $doc_root, errmsg => $oops, sizefmt => ('bytes' || 'abbrev'), timefmt => $time_fmt, MAX_RECURSIONS => $default_100, # when to stop infinite loops w/ error msg COOKIE_JAR => HTTP::Cookies->new, $ssi->config($type, $arg) $type is either 'sizefmt', 'timefmt', or 'errmsg'. $arg is similar to those of the SSI "spec", referenced below. $ssi->set($varname => $value) Sets variables internal to the CGI::SSI object. (Not to be confused with the normal variables your script uses!) These variables may be used in test expressions, and retreived using $ssi->echo($varname). These variables also will not be available in external, included resources. $ssi->echo($varname) Returns the value of the variable named $varname. Such variables may be set manually using the "set()" method. There are also several built-in variables: DOCUMENT_URI - the URI of this document DOCUMENT_NAME - the name of the current document DATE_GMT - the same as 'gmtime' DATE_LOCAL - the same as 'localtime' LAST_MODIFIED - the last time this script was modified $ssi->exec($type, $arg) $type is either 'cmd' or 'cgi'. $arg is similar to the SSI "spec" (see below). $ssi->include($type, $arg) Similar to "exec", but "virtual" and "file" are the two valid types. SSI variables will not be available outside of your CGI::SSI object, regardless of whether the virtual resource is on the local system or a remote system. $ssi->flastmod($type, $filename) Similar to "include". $ssi->fsize($type, $filename) Same as "flastmod". $ssi->printenv Returns the environment similar to Apache's mod_include. $ssi->cookie_jar([$jar]) Returns the currently-used HTTP::Cookies object. You may optionally pass in a new HTTP::Cookies object. The jar is used for web requests in exec cgi and include virtual directives. FLOW-CONTROL METHODS The following methods may be used to test expressions. During a "block" where the test $expr is false, nothing will be returned (or printed, if tied). $ssi->if($expr) The expr can be anything Perl, but care should be taken. This causes problems: $ssi->set(varname => "foo"); <!--#if expr="'$varname' =~ /^foo$/" -->ok<!--#endif --> The $varname is expanded as you would expect. (We escape it so as to use the $varname within the CGI::SSI object, instead of that within our progam.) But the $/ inside the regex is also expanded. This is fixed by escaping the "$": <!--#if expr="'$varname' =~ /^value$/" -->ok<!--#endif --> The expressions used in if and elif tags/calls are tricky due to the number of escapes required. In some cases, you'll need to write "\\" to mean "". $ssi->elif($expr) $ssi->else $ssi->endif SEE ALSO
"Apache::SSI" and the SSI "spec" at http://www.apache.org/docs/mod/mod_include.html AUTHOR
(c) 2000-2005 James Tolley <james@bitperfect.com> All Rights Reserved. This is free software. You may copy and/or modify it under the same terms as perl itself. CREDITS
Many Thanks to Corey Wilson and Fitz Elliot for bug reports and fixes. perl v5.12.4 2007-08-08 SSI(3pm)
All times are GMT -4. The time now is 09:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy