Perl : accept multiple user entered command line arguemnts
I am trying to create a script that will accept multi input from the user (really just me), then execute those command on a remote device.
My question is if the I enter "No" at the confirmation point "Are these statements correct y or n ?", what is the best way to go back and start over ? I have been trying different things with while and until flags but nothing is working.
Hi everyone,
Can someone possibly help me with this problem I am having please.
I wrote a Korn shell script to manipulate currency amounts in a way that a person could use this script to determine the minimum number of coins required to make a certain amount.
for example when entered on the... (2 Replies)
I have a script like this--
#!/bin/ksh
echo "To pad a 0 before digits from 1-9"
for i in $*
do
echo $i | sed 's//'0'/g'
done
I run this script as
ksh name 1 2 23 34
The output should be
01 02 23 34
Help me in modifying this script.
Thanks
Namish (2 Replies)
Dear All,
The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script.
Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt.
Please fins the below sample script which i tried.
SCRIPT:
--------
#!... (4 Replies)
Hi
I want to accept multiple lines input with spaces from User and i have a working code like this.
char sRes;
char sReq;
printf("Please enter request:");
scanf("%",sReq); /* Accept the input from user */
printf("\nPlease enter response:");
scanf("%",sRes);
but the... (4 Replies)
Say I have a ksh program called test.ksh which has several defined arrays inside it such as array1,array2,array3...These arrays contain strings.
I also have a method in the program:
for x in $1
do
....(#do something)
done
So, when the user enteres: ./test.ksh array1, I want to... (3 Replies)
Hello
Does the unix korn shell provide a function to convert number entered in command line argument to text or Character so that in next step i will convert Chr to Hex (6 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
1) The script is executed in the Korn shell.
2) Name the shell script file is asg6s.
3) The asg6s file is... (7 Replies)
I am looking for help in processing of those options: '-n' or '-p'
I understand what they do and how to use them.
But, I would like to use them with more than one file (and without any shell-loop; loading the 'perl' once.)
I did try it and -n works on 2 files.
Question is:
- is it possible to... (6 Replies)
Discussion started by: alex_5161
6 Replies
LEARN ABOUT DEBIAN
auth::yubikey_webclient
Auth::Yubikey_WebClient(3pm) User Contributed Perl Documentation Auth::Yubikey_WebClient(3pm)NAME
Auth::Yubikey_WebClient - Authenticating the Yubikey against the Yubico Web API
VERSION
Version 3.00
SYNOPSIS
Authenticate against the Yubico server via the Web API in Perl
Sample CGI script :-
#!/usr/bin/perl
use CGI;
$cgi = new CGI;
$otp = $cgi->param("otp");
print "Content-type: text/html
";
print "<html>
";
print "<form method=get>Yubikey : <input type=text name=otp size=40 type=password></form>
";
use Auth::Yubikey_WebClient;
$id = "<enter your id here>";
$api = "<enter your API key here>";
$nonce = "<enter your nonce here>";
if($otp)
{
$result = Auth::Yubikey_WebClient::yubikey_webclient($otp,$id,$api,$nonce);
# result can be either ERR or OK
print "Authentication result : <b>$result</b><br>";
}
print "</html>
";
FUNCTIONS
new
Creates a new Yubikey Webclient connection
use Auth::Yubikey_WebClient;
my $yubi = Auth::Yubikey_WebClient->new({
id => <enter your id here> ,
api => '<enter your API key here>' ,
nonce => '<enter your nonce if you have one>'
});
You can overwrite the URL called if you want to call an alternate authentication server as well :-
use Auth::Yubikey_WebClient;
my $yubi = Auth::Yubikey_WebClient->new({
id => <enter your id here> ,
api => '<enter your API key here>' ,
nonce => '<enter your nonce if you have one>',
url => 'http://www.otherserver.com/webapi.php'
});
debug
Displays the debug info
$yubi->debug();
Prints out some debug information. Useful to be called after authentication to see what Yubico sent back. You can also call the variables
yourself, for example if you'd like to see what the token ID is, call $yubi->{publicid}. The same goes for all the other variables printed
in debug.
yubikey_webclient
otp
Check a OTP for validity
$result = $yubi->otp($otp);
Call the otp procedure with the input from the yubikey. It will return the result.
This function will also setup a few internal variables that was returned from Yubico.
USAGE
Before you can use this module, you need to register for an API key at Yubico. This is as simple as logging onto
<https://upgrade.yubico.com/getapikey/> and entering your Yubikey's OTP and your email address. Once you have the API and ID, you need to
provide those details to the module to work.
AUTHOR
Phil Massyn, "<phil at massyn.net>"
BUGS
Please report any bugs or feature requests to "bug-auth-yubikey_webclient at rt.cpan.org", or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Auth-Yubikey_WebClient <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Auth-
Yubikey_WebClient>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Auth::Yubikey_WebClient
You can also look for information at:
o RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Auth-Yubikey_WebClient <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Auth-Yubikey_WebClient>
o AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Auth-Yubikey_WebClient <http://annocpan.org/dist/Auth-Yubikey_WebClient>
o CPAN Ratings
http://cpanratings.perl.org/d/Auth-Yubikey_WebClient <http://cpanratings.perl.org/d/Auth-Yubikey_WebClient>
o Search CPAN
http://search.cpan.org/dist/Auth-Yubikey_WebClient <http://search.cpan.org/dist/Auth-Yubikey_WebClient>
Version history
0.04 - Fixed bug <http://rt.cpan.org/Public/Bug/Display.html?id=51121> 1.00 - Added validation of the request to Yubico (Thanks to Kirill
Miazine) 2.00 - Added nounce coding (Thanks to Ludvig af Klinteberg) 2.01 - Response turning into an array due to
bug (Thanks to Peter
Norin)
ACKNOWLEDGEMENTS COPYRIGHT & LICENSE
Copyright 2010 Phil Massyn, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-01-14 Auth::Yubikey_WebClient(3pm)