Sponsored Content
Top Forums Programming How to simplify this perl script to a cleaner simpler look? Post 302462512 by callyvan on Thursday 14th of October 2010 11:28:37 AM
Old 10-14-2010
thanks Corona688
It does seem to shorten and possible simplify, not all to familiar with hash arrays so will have to educate myself on how they work to better understand your solution.

thanks :-)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

a script to simplify the use of grep

I'm trying to write a script that simplify the use of grep utility. these are the option that I'd like to use with the script " -c -i -l -n -v". When I execute the script none of these option works. I really appreciate any idea or tips regarding this problem. here the code echo " Enter 1-7:"... (2 Replies)
Discussion started by: kemobyte
2 Replies

2. Shell Programming and Scripting

How can I simplify the script

Hi all, How can I simplify following script, Logic is to find two strings (strings are case sensitive) from a file. if ; then if ; then Group=`echo $1_hostname` fi fi Please help me on this. Regards Sudhish s. kumar (8 Replies)
Discussion started by: sudhish
8 Replies

3. Shell Programming and Scripting

Is there a simpler way to achieve this?

Hi all I have the following which is part of a larger interactive script for adding virtual hosts to Apache's configuration (it was built for non-technical administrators). I'm curious as to whether there is a simpler way of achieving the same thing. All it does is look into the... (3 Replies)
Discussion started by: mlott
3 Replies

4. Shell Programming and Scripting

simplify the script, check field match to value in a file

Hi Everyone, Below is the script, i feel there should be more simple way to do the same output, my one works, but feel not nice. like using index i feel it is slow (image my file is very large), maybe awk can do one line code? Please advice. # cat 1.txt 1 a 2 b 3 cc 4 d # cat 1.pl... (6 Replies)
Discussion started by: jimmy_y
6 Replies

5. Shell Programming and Scripting

Can I simplify this script?

Hi all, I have a script which runs every morning which clears down a series of directories. The structures of which are; /opt/feeds/failed/feed1 /opt/feeds/succeed/feed1 /opt/feeds/failed/feed2 /opt/feeds/succeed/feed2 /opt/feeds/failed/feed3 /opt/feeds/succeed/feed3 etc etc Files... (6 Replies)
Discussion started by: JayC89
6 Replies

6. What is on Your Mind?

A simpler XML tool

We've been getting a lot of XML questions lately, and I suspect it's only going to get worse better ... Normal shell utilities just can't handle it and the "proper" solutions, do-everything perl modules or things like xmlstarlet, just make my head ache. Started coding something tonight. What... (10 Replies)
Discussion started by: Corona688
10 Replies

7. Shell Programming and Scripting

Cleaner method for this if-then statement?

I have a script that runs once per month. It performs a certain task ONLY if the month is January, April, July, or October. MONTH=`date +%m` if || || || ; then do something else do a different thing fi Is there a neater way of doing it than my four separate "or" comparisons? That... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

8. Shell Programming and Scripting

Need simpler version of these commands

Hi all, I am trying to grep a file with the word grand and get all the fields.. Then replace multiple spaces with single space and then get 8 th field and add all these numbers . I am able to do it but with so amny commands which i feel can be done in a simpler way Please let me know if... (4 Replies)
Discussion started by: Hypesslearner
4 Replies

9. Shell Programming and Scripting

A cleaner way to rearrange column

Hello, I have some tab delimited text data, index name chg_p chg_m 1 name,1 1 0 2 name,2 1 1 3 name,3 1 0 4 name,4 1 0 5 name,5 1 1 I need to duplicate the "index" column, call it "id" and insert it after the... (8 Replies)
Discussion started by: LMHmedchem
8 Replies

10. Shell Programming and Scripting

Maybe a cleaner way to generate a file?

greetings, to be clear, i have a solution but i'm wondering if anyone has a cleaner way to accomplish the following: the variable: LSB_MCPU_HOSTS='t70c7n120 16 t70c7n121 16 t70c7n122 16 t70c7n123 16 t70c7n124 16 t70c7n125 16 t70c7n126 16 t70c7n127 16 t70c7n128 16 t70c7n129 16 t70c7n130 16... (2 Replies)
Discussion started by: crimso
2 Replies
Authen::Passphrase::EggdropBlowfish(3pm)		User Contributed Perl Documentation		  Authen::Passphrase::EggdropBlowfish(3pm)

NAME
Authen::Passphrase::EggdropBlowfish - passphrases using Eggdrop's blowfish.mod SYNOPSIS
use Authen::Passphrase::EggdropBlowfish; $ppr = Authen::Passphrase::EggdropBlowfish->new( hash_base64 => "9tpsG/61YqX/"); $ppr = Authen::Passphrase::EggdropBlowfish->new( passphrase => "passphrase"); $hash = $ppr->hash; $hash_base64 = $ppr->hash_base64; if($ppr->match($passphrase)) { ... DESCRIPTION
An object of this class encapsulates a passphrase hashed using the Blowfish-based algorithm used in Eggdrop's blowfish.mod. This is a subclass of Authen::Passphrase, and this document assumes that the reader is familiar with the documentation for that class. This hash scheme uses no salt, and does not accept a zero-length passphrase. It uses the passphrase as a Blowfish key to encrypt a standard plaintext block. The hash is the ciphertext block. The standard Blowfish key schedule only accepts keys from 8 to 56 bytes long; this algorithm relaxes that requirement and accepts any non-zero length. Up to 72 bytes of passphrase/key are significant; any more are ignored. In Eggdrop the hash is represented as a "+" followed by twelve base 64 digits. The first six digits encode the second half of the hash, and the last six encode the first half. Within each half the bytes are encoded in reverse order. The base 64 digits are ".", "/", "0" to "9", "a" to "z", "A" to "Z" (in that order). Warning: The hash is small by modern standards, and the lack of salt is a weakness in this scheme. For a scheme that makes better use of Blowfish see Authen::Passphrase::BlowfishCrypt. CONSTRUCTOR
Authen::Passphrase::EggdropBlowfish->new(ATTR => VALUE, ...) Generates a new passphrase recogniser object using the Eggdrop blowfish.mod algorithm. The following attributes may be given: hash The hash, as a string of eight bytes. hash_base64 The hash, as a string of twelve base 64 digits. passphrase A passphrase that will be accepted. Either the hash or the passphrase must be given. METHODS
$ppr->hash Returns the hash value, as a string of eight bytes. $ppr->hash_base64 Returns the hash value, as a string of twelve base 64 digits. $ppr->match(PASSPHRASE) This method is part of the standard Authen::Passphrase interface. SEE ALSO
Authen::Passphrase, Crypt::Eksblowfish::Uklblowfish AUTHOR
Andrew Main (Zefram) <zefram@fysh.org> COPYRIGHT
Copyright (C) 2006, 2007, 2009, 2010, 2012 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-07 Authen::Passphrase::EggdropBlowfish(3pm)
All times are GMT -4. The time now is 10:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy