hey,
im looking for a way of extending a string in shell script.
for example i have two strings "." and "abcd",
i need to extend the first string so that it is the same length as the second.
so "." and "abcd" becomes "...." and "abcd",
could someone shed light on how to do this ? thanks (4 Replies)
Hi all,
I had a typical problem.
I am using a parameter
PK="PK1 PK2 PK3"
i need to build the string
a.PK1=b.PK1 and a.PK2=b.PK2 and a.PK3=b.PK3
Please help (8 Replies)
Hi
I need help with a script to read certain strings from a file, the content is as below.
File A
=====
grant select on *.* TO 'root'@'localhost' identified by password 'sfsdfsdfsd';
I need all the words between grant and TO in to a new file.
I also need the value right next to... (13 Replies)
Hi,
I am new to Unix server and shell scripting.I want to encrypt username/password using shell script.I know that there's a Crypt command to encrypt but it is not installed in my unix server and cannot be installed due to some reason.So i want the shell script of the crypt command or is there... (3 Replies)
I am writing a shell script for some purpose. I have a variable of the form -- var1 = "policy=set policy"
Now I need to manipulate the variable var to get the string after index =. that is i should have "set polcy". Also I need to to this for many other variables where the value of "=" is not... (3 Replies)
HI,
I have a string "NZ-deploy-mode-1.15-Linux.x86_64.rpm"
I want to get the string before -1 ie "NZ-deploy-mode"
Input is "NZ-deploy-mode-1.15-Linux.x86_64.rpm"
expected output is "NZ-deploy-mode"
How can I do that in shell script?
Thanks in advance. (6 Replies)
Hi All,
I am trying to to compare a string variable with a string literal inside a loop but keep getting the
./testifstructure.sh: line 6:
#!/bin/sh
BOOK_LIST="BOOK1 BOOK2"
for BOOK in ${BOOK_LIST}
do
if
then echo '1'
else
echo '2'
fi
done
Please use next... (1 Reply)
Hi All,
I am a newbie...I would like to have a function which ll check if a file contains valid strings before "=" operator. Just to give you my requirement:
assume my file has content:
hello= gsdgsd sfdsg sgdsg sgdgdg
world= gggg hhhh iiiii
xxxx= pppp ppppp pppp
my... (1 Reply)
What does -a operator for String manipulation imply?
Eg: if ;then (2 Replies)
Discussion started by: Sree10
2 Replies
LEARN ABOUT DEBIAN
string::dirify
String::Dirify(3pm) User Contributed Perl Documentation String::Dirify(3pm)NAME
"String::Dirify" - Convert a string into a directory name
Synopsis
use String::Dirify;
my($dir_1) = String::Dirify -> dirify('frobnitz');
Or:
use String::Dirify ':all';
my($dir_2) = dirify('bar baz');
Or even:
use String::Dirify;
my($sd) = String::Dirify -> new();
my($dir_3) = $sd -> dirify('!Q@W#E$R%T^Y');
Description
"String::Dirify" is a pure Perl module.
This module allows you to convert a string (possibly containing high ASCII characters, and even HTML) into another, lower-cased, string
which can be used as a directory name.
For usage, see the Synopsis.
This code is derived from similar code in Movable Type.
Method: dirify($string [, $separator])
Returns a string, which can be used as a directory name.
The default separator is '_'.
Each run of spaces in the string is replaced by this separator.
Algorithm
1: Each high ASCII character is replaced by its normal equivalent
2: The string is converted to lower case
3: Any HTML (including HTML entities) in the string is removed
4: Any characters which are not (Perl) words, spaces or hyphens, are removed
5: Runs of spaces are converted to the separator character
For more details about this character, see the discussion of the dirify() method (above).
Melody 'v' Movable Type
See http://openmelody.org for details.
Backwards Compatibility with Movable Type
Unfortunately, Movable Type's usage of dirify() allows a fake separator - '1' - to be used for the second parameter in the call to
dirify().
The '1' triggered usage of '_' as the separator, rather than the '1' provided.
This 'feature' has been preserved in "String::Dirify", but is discouraged. Instead, simply drop the second parameter and let the code
default to '_'.
Distributions
This module is available as a Unix-style distro (*.tgz).
See http://savage.net.au/Perl-modules.html for details.
Authors
"String::Dirify" started out as part of Movable Type's code.
Then, Mark Stosberg cut down the original code to provide just the English/ISO/ASCII features.
Lastly, the code was cleaned up, tests added, and all packaged, by Ron Savage <ron@savage.net.au> in 2009.
Home page: http://savage.net.au/index.html
Copyright (c) 2009, Mark Stosberg, Ron Savage.
Copyright (c) 2010, 2011, Ron Savage.
perl v5.10.1 2011-01-08 String::Dirify(3pm)