Sorry if the title is not good but I did not know how to explain with only some words!
What I meant is: I have a unix command built from a private application vendor that when executed it prompts for two entries by the keyboard, let's say, for example:
After inputting the information above using the keyboard and pressing <EnteR>, it shows an output like below:
Finally, my question is:
Is there a way to put the command above inside a shell script?
The user must enter the two fields and after I need to get the "Encripted Password".
I'm trying to write a simple script program (C shell). I have a problem redirecting input into a variable. Say I have a variable called J, and there is file called result which contains just some number, say 5. Which command should I use to assign J value 5 from the file result. I tried the... (2 Replies)
I need to run a command inside root-environment, and want to use:
su - root -c "some command..."
Then I am prompted for a password, of course.
Is it possible to put this password in a file, and present this files content, to the command above?:confused: (1 Reply)
Dear All:
I am trying to do something that (I thought) was relatively straightforward, but my code snippet does not seem to work.
Any suggestions?
Thank you
Sincerely yours
Misha Koshelev
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include... (0 Replies)
Hi,
I have a function in a bash script that returns a string after some operations using awk.
The following code returns 555
$VARIABLE="EXAMPLE"
get_number $VARIABLE
this value I'd like to pass it as a second argument of another script with the following usage
myscript.sh <param1>... (7 Replies)
for every specific $1,$2 check the values ($2,$3) of their E ot I of input1 and overlap with input2.
Specify names based on output.
#######
if middle value is missing name them "SE"
if first value is missing name them "AFE"
if last value is missing name them "ALE"
if 2 middle values are... (1 Reply)
Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions.
... (4 Replies)
Hi ,
i am having an file which contains 5 file_name data, i need to read the file name and will perform certain operation and generate out file names with named as 5 individual file_names
for eg:
file.txt contains
file_name1.txt|hai
file_name2.txt|bye
file_name3.txt|how... (3 Replies)
Hi Guys,
I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts.
I used below but it is not working:
OFILE=/home/home1/report1
echo "report1 details" > $OFILE
=/home/home1/1.sh > $OFILE
echo... (7 Replies)
Hi,
I want to compare a value from test file and redirect the o/p value to the same file
input file
250 32000 32 128
Below is my code
awk '{ if ($1 < "300") print $1 > /tmp/test}' test
want to compare 250 < 300 then print 300 to the same place
below is the... (24 Replies)
Discussion started by: stew
24 Replies
LEARN ABOUT DEBIAN
cgi::application::plugin::redirect
CGI::Application::Plugin::Redirect(3pm) User Contributed Perl Documentation CGI::Application::Plugin::Redirect(3pm)NAME
CGI::Application::Plugin::Redirect - Easy external redirects in CGI::Application
SYNOPSIS
package My::App;
use CGI::Application::Plugin::Redirect;
sub cgiapp_prerun {
my $self = shift;
if ( << not logged in >> ) {
return $self->redirect('login.html');
}
}
sub byebye {
my $self = shift;
return $self->redirect('http://www.example.com/', '301 Moved Permanently');
}
DESCRIPTION
This plugin provides an easy way to do external redirects in CGI::Application. You don't have to worry about setting headers or worrying
about return types, as that is all handled for you.
"redirect" does an external redirect, which means that the browser will receive a command to load a new page, and a fresh request will come
in. If you just want to display the results of another runmode within the same module, then it is often sufficient to use the "forward"
method in CGI::Application::Plugin::Forward instead.
METHODS
redirect($url, $status)
Interupt the current request, and redirect to an external URL. If you happen to be inside a prerun method when you call this, the current
runmode will automatically be short circuited so that it will not execute. As soon as all prerun method have finished, the redirect will
happen without the runmode being executed.
The $status parameter is optional as the CGI module will default to something suitable.
return $self->redirect('http://www.example.com/');
- or -
return $self->redirect('http://www.example.com/', '301 Moved Permanently');
SEE ALSO
CGI::Application, CGI::Application::Plugin::Forward, perl(1)AUTHOR
Cees Hek <ceeshek@gmail.com>
LICENCE AND COPYRIGHT
Copyright (c) 2005, Cees Hek. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED ORIMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSESSUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
perl v5.12.3 2011-06-25 CGI::Application::Plugin::Redirect(3pm)