03-18-2003
Works like a charm...thanks.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the necessity to use this command:
cat file1 | grep $A | grep $B
where sometime A and, or, B are not set.
For example:
I set A=@
never defined or set B
The above command send a cat error.
Any idea?
Thanks.
Giovanni (1 Reply)
Discussion started by: gio123bg
1 Replies
2. Shell Programming and Scripting
Hello
I want to check for NULL variable..
but this is not working..please help
thanks in advance
esham (2 Replies)
Discussion started by: esham
2 Replies
3. Shell Programming and Scripting
hi forum
i beginning with script and i want test un null variable in a schell
i just don t know the syntax here is a litle example
y=test
echo $y
unset y
echo $y (so here Y = Null)
if Y=Null
then
echo "y is null"
exit
fi (1 Reply)
Discussion started by: kykyboss
1 Replies
4. Shell Programming and Scripting
Hi,
I have to check whether an argument say $ARGV is not null in an if operator. Please let me know the operator. It would be great if you write a psuedo code.
Thanks in advance
Ammu (4 Replies)
Discussion started by: ammu
4 Replies
5. Shell Programming and Scripting
korn shell
If
then
update_smartcare_user_password "$u_id"
else
echo "Not a database user"
fi
i get this error
Syntax error at line *** : `then' is not expected.
what should i do.
I want to check whether $a is null or not. (2 Replies)
Discussion started by: sachin.gangadha
2 Replies
6. Shell Programming and Scripting
Hi all, I have a stupid question on NULL and zero(0).
In a script I've been working with, one of the lines is:
if &&
then
The problem I seem to have is when $Current_csm2 is null, this if block is not triggered, and I don't get why because I was under the impression that NULL!=0
Can... (7 Replies)
Discussion started by: spynappels
7 Replies
7. Shell Programming and Scripting
Hello, Unix-forums!
My problem:
read -p "Enter any number, please" number
sleep 1
echo $number | tr -d 0-9
test -z $number && echo "Thank you" || echo "This is not a number"Test always displays "This is not a number". It doesn't matter if I entered a or 1.
But if I order
echo... (2 Replies)
Discussion started by: intelinside
2 Replies
8. Shell Programming and Scripting
i have this code
for i in `cat sql_output.txt`
do
-- some script commands
done
sql_output.txt has 1 column with employee_ids
If the sql_output.txt is null then the do loop should not execute.
How can i implement this.
for i in `cat sql_output.txt`
If i is null or empty
then ... (5 Replies)
Discussion started by: rafa_fed2
5 Replies
9. Shell Programming and Scripting
Guys,
Please help me on the below
sample.cfg
var=NULL
sample.sh
#!/bin/sh
. /sample.cfg
if ;then
1 st command here
else
2 nd command here
fi (3 Replies)
Discussion started by: AraR87
3 Replies
10. Shell Programming and Scripting
DELETE=`cat $logfile1 | egrep -i "Delete" | sed 's/ */ /g' | cut -d" " -f2`
INSERT=`cat $logfile1 | egrep -i "Insert" | sed 's/ */ /g' | cut -d" " -f2`
UPDATE=`cat $logfile1 | egrep -i "Update" | sed 's/ */ /g' | cut -d" " -f2`
I need soming like below:
if value is null... (8 Replies)
Discussion started by: Veera_V
8 Replies
LEARN ABOUT DEBIAN
cgi::psgi
CGI::PSGI(3pm) User Contributed Perl Documentation CGI::PSGI(3pm)
NAME
CGI::PSGI - Adapt CGI.pm to the PSGI protocol
SYNOPSIS
use CGI::PSGI;
my $app = sub {
my $env = shift;
my $q = CGI::PSGI->new($env);
return [ $q->psgi_header, [ $body ] ];
};
DESCRIPTION
This module is for web application framework developers who currently uses CGI to handle query parameters, and would like for the
frameworks to comply with the PSGI protocol.
Only slight modifications should be required if the framework is already collecting the body content to print to STDOUT at one place
(rather using the print-as-you-go approach).
On the other hand, if you are an "end user" of CGI.pm and have a CGI script that you want to run under PSGI web servers, this module might
not be what you want. Take a look at CGI::Emulate::PSGI instead.
Your application, typically the web application framework adapter should update the code to do "CGI::PSGI->new($env)" instead of "CGI->new"
to create a new CGI object. (This is similar to how CGI::Fast object is initialized in a FastCGI environment.)
INTERFACES SUPPORTED
Only the object-oriented interface of CGI.pm is supported through CGI::PSGI. This means you should always create an object with
"CGI::PSGI->new($env)" and should call methods on the object.
The function-based interface like "use CGI ':standard'" does not work with this module.
METHODS
CGI::PSGI adds the following extra methods to CGI.pm:
env
$env = $cgi->env;
Returns the PSGI environment in a hash reference. This allows CGI.pm-based application frameworks such as CGI::Application to access PSGI
extensions, typically set by Plack Middleware components.
So if you enable Plack::Middleware::Session, your application and plugin developers can access the session via:
$cgi->env->{'plack.session'}->get("foo");
Of course this should be coded carefully by checking the existence of "env" method as well as the hash key "plack.session".
psgi_header
my ($status_code, $headers_aref) = $cgi->psgi_header(%args);
Works like CGI.pm's header(), but the return format is modified. It returns an array with the status code and arrayref of header pairs that
PSGI requires.
If your application doesn't use "$cgi->header", you can ignore this method and generate the status code and headers arrayref another way.
psgi_redirect
my ($status_code, $headers_aref) = $cgi->psgi_redirect(%args);
Works like CGI.pm's redirect(), but the return format is modified. It returns an array with the status code and arrayref of header pairs
that PSGI requires.
If your application doesn't use "$cgi->redirect", you can ignore this method and generate the status code and headers arrayref another way.
LIMITATIONS
Do not use CGI::Pretty or something similar in your controller. The module messes up CGI's DIY autoloader and breaks CGI::PSGI (and
potentially other) inheritance.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
Mark Stosberg <mark@summersault.com>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
CGI, CGI::Emulate::PSGI
perl v5.12.4 2011-08-29 CGI::PSGI(3pm)