Hi all,
Not sure if this is the right forum to post query regarding perl script.
I have a perl script which internally calls a shell script. My problem is that the shell script should be passed command line arguments.
I call a shell script from perl using:
system("sript.sh");
How do... (3 Replies)
Hi,
I would like to invoke "Winzip" utility from a perl script, input the name of zip file and provide output path for unzipped files. Any pointers will be appreciated.
Thanks (5 Replies)
I call a EXPECT script from my perl script with machine IP and a FIle. The script logins to the machine and exports the value. The values to be exported or stored in a file.
I have close to 10 machines and I have created 10 files and pass the corresponding files in command line, Now I could like... (4 Replies)
Hi ,
Here is my piece of code--
main();
sub main
{
$result = GetOptions ("LogDir=s" => \$LogDir,
"Summary" => \$Summary,
"Indiviual=s" => \$Individual ,
"Diagnostics=s" => \$Diagnostics,
... (1 Reply)
I am getting a strange error with perl's inbuilt script flush.pl. I am callling this script in my other script but it kept throwing error:
flush.pl did not return a true value at ./abc.pl line 1
abc.pl has:
require 'flush.pl';
Not sure why this error is coming. Can someone pls throw... (4 Replies)
I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell... (5 Replies)
I am trying to run a perl script which needs input arguments from a parent perl script, but doesn't seem to work. Appreciate your help in this regard.
From parent.pl
$input1=123;
$input2=abc;
I tried calling it with
system("/usr/bin/perl child.pl $input1 $input2");
and
`perl... (1 Reply)
Can someone let me know how could I achieve this
In one of per script I am calling the shell script but I need to so one thing that is one shell script call I need to pass pne argument.In below code I am calling my ftp script but here I want to pass one argument so how could I do this (e.g:... (5 Replies)
Hi,
I am working on a sever A.
I want to write a perl script to execute a shell script persent on the server B.
please help me in this.
thanks in advance. (3 Replies)
I am calling a perl script from shell script.
$ cat mah_appln_bkp_oln.ksh
#!/bin/ksh
. /udb/home/udbappln/.profile
. /udb/home/udbappln/sqllib/db2profile
Com=/udb/udbappln/utility/systemscripts/currentUMR
perl $Com/backup.pl -d dbname --tsm --purgetsmcopies 21 --purgetsmlogs
exit 0
... (1 Reply)
Discussion started by: ilugopal
1 Replies
LEARN ABOUT SUSE
crypt::smbhash
SmbHash(3) User Contributed Perl Documentation SmbHash(3)NAME
Crypt::SmbHash - Perl-only implementation of lanman and nt md4 hash functions, for use in Samba style smbpasswd entries
SYNOPSIS
use Crypt::SmbHash;
ntlmgen SCALAR, LMSCALAR, NTSCALAR;
DESCRIPTION
This module generates Lanman and NT MD4 style password hashes, using perl-only code for portability. The module aids in the administration
of Samba style systems.
In the Samba distribution, authentication is referred to a private smbpasswd file. Entries have similar forms to the following:
username:unixuid:LM:NT
Where LM and NT are one-way password hashes of the same password.
ntlmgen generates the hashes given in the first argument, and places the result in the second and third arguments.
Example: To generate a smbpasswd entry:
#!/usr/local/bin/perl
use Crypt::SmbHash;
$username = $ARGV[0];
$password = $ARGV[1];
if ( !$password ) {
print "Not enough arguments
";
print "Usage: $0 username password
";
exit 1;
}
$uid = (getpwnam($username))[2];
my ($login,undef,$uid) = getpwnam($ARGV[0]);
ntlmgen $password, $lm, $nt;
printf "%s:%d:%s:%s:[%-11s]:LCT-%08X
", $login, $uid, $lm, $nt, "U", time;
ntlmgen returns returns the hash values in a list context, so the alternative method of using it is:
( $lm, $nt ) = ntlmgen $password;
The functions lmhash and nthash are used by ntlmgen to generate the hashes, and are available when requested:
use Crypt::SmbHash qw(lmhash nthash)
$lm = lmhash($pass);
$nt = nthash($pass);
If Encoding is available (part of perl-5.8) the $pass argument to ntlmgen, lmhash and nthash must be a perl string. In double use this:
use Crypt::SmbHash qw(ntlmgen lmhash nthash);
use Encode;
( $lm, $nt ) = ntlmgen decode('iso-8859-1', $pass);
$lm = lmhash(decode_utf8($pass), $pwenc);
$nt = nthash(decode_utf8($pass));
The $pwenc parameter to lmhash() is optional and defaults to 'iso-8859-1'. It specifies the encoding to which the password is encoded
before hashing.
MD4
The algorithm used in nthash requires the md4 algorithm. This algorithm is included in this module for completeness, but because it is
written in all-perl code ( rather than in C ), it's not very quick.
However if you have the Digest::MD4 module installed, Crypt::SmbHash will try to use that module instead, making it much faster.
A simple test compared calling nthash without Digest::MD4 installed, and with, this showed that using nthash on a system with Digest::MD4
installed proved to be over 90 times faster.
AUTHOR
Ported from Samba by Benjamin Kuit <lt>bj@it.uts.edu.au<gt>.
Samba is Copyright(C) Andrew Tridgell 1997-1998
Because this module is a direct port of code within the Samba distribution, it follows the same license, that is:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
perl v5.12.1 2004-10-17 SmbHash(3)