12-07-2013
You store something in the variable plain but then do not use it?!
10 More Discussions You Might Find Interesting
1. AIX
Hi,
Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies
2. Shell Programming and Scripting
Hi.
In a simple sed script i have number signs - #. But i can't find any description on their functionality. One thing that i find is that # in sed scripts can mean comment if it is placed in the beginning of the line.
I thought may be this undocumented(for me) behavior refers to regular... (1 Reply)
Discussion started by: kukuruku
1 Replies
3. Shell Programming and Scripting
Hello gurus,
I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script.
i m looking for something like this
call 3.1;
If 3.1 = "complete" then
call 3.2;
if 3.2 = ''COMPlete" then
call 3.3;
else
exit
The... (1 Reply)
Discussion started by: shashi369
1 Replies
4. Shell Programming and Scripting
I am having a lot of trouble, wasting a lot of time trying to get sed script files to run without problem. I have a list of scripts I want to run on a text file to turn it into a viewable html file for my mobile phone. Each of the single scripts when run in order/sequence one after another on the... (4 Replies)
Discussion started by: naphelge
4 Replies
5. Shell Programming and Scripting
Hi All,
After reading that the sort command in Linux can be made to use many processor cores just by using a simple script which I found on the internet, I was wondering if I can use similar techniques for programs like the awk and sed?
#!/bin/bash
# Usage: psort filename <chunksize>... (7 Replies)
Discussion started by: shoaibjameel123
7 Replies
6. Shell Programming and Scripting
Hi, I was hoping that someone could help me. I have a problem that i am trying to work on and it requires me to change text within multiple files using sed. I use the program to change an occurance of a word throughout different files that are being tested. At first i had to Create a new script,... (1 Reply)
Discussion started by: Johnny2518
1 Replies
7. Homework & Coursework Questions
Hi, I was hoping that someone could help me. I have a problem that i am trying to work on and it requires me to change text within multiple files using sed. What i have so far is
!/bin/sh
File1="$3"
File2="$4"
File3="$5"
testNum="$File1"
while test "$testNum" <= "$File3";
do
echo... (12 Replies)
Discussion started by: Johnny2518
12 Replies
8. UNIX for Dummies Questions & Answers
Morning all
I've got loads of scripts but the names are too long! I've stuck the list in a flat file (names) and I'm trying to read that in line by line and create the new names (in to directory new) from the list. It looks like this:
xargs -n1 -I{} <names cat {} | sed... (1 Reply)
Discussion started by: Grueben
1 Replies
9. Shell Programming and Scripting
Hi
I probably dont have GNU extended sed in my SUNOS . and its creating lot of problems
ex:
a simple sed command like this is not working
sed '/WORD/ a\
sample text line 1 \
sample text line 1
' filename
sed: command garbled: /WORD/ a
I took precaution to have a new line after... (11 Replies)
Discussion started by: vash
11 Replies
10. Homework & Coursework Questions
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:
Generalize your sub2 script, producing a new script sub3 that will apply a substitution to any number of files... (16 Replies)
Discussion started by: raymondbn
16 Replies
LEARN ABOUT DEBIAN
data::phrasebook::loader::text
Data::Phrasebook::Loader::Text(3pm) User Contributed Perl Documentation Data::Phrasebook::Loader::Text(3pm)
NAME
Data::Phrasebook::Loader::Text - Absract your phrases with plain text files.
SYNOPSIS
use Data::Phrasebook;
my $q = Data::Phrasebook->new(
class => 'Fnerk',
loader => 'Text',
file => 'phrases.txt',
);
# use default delimiters (:variable)
my $phrase = $q->fetch($keyword,{variable => 'substitute'});
# use Template Toolkit style delimiters
$q->delimiters( qr{ [% s* (w+) s* %] }x );
my $phrase = $q->fetch($keyword,{variable => 'substitute'});
DESCRIPTION
This loader plugin implements phrasebook patterns using plain text files.
Phrases can be contained within one or more dictionaries, with each phrase accessible via a unique key. Phrases may contain placeholders,
please see Data::Phrasebook for an explanation of how to use these. Groups of phrases are kept in a dictionary. In this implementation a
single file is one complete dictionary.
An example plain text file:
foo=Welcome to :my world. It is a nice :place.
Within the phrase text placeholders can be used, which are then replaced with the appropriate values once the get() method is called. The
default style of placeholders can be altered using the delimiters() method.
INHERITANCE
Data::Phrasebook::Loader::Text inherits from the base class Data::Phrasebook::Loader::Base. See that module for other available methods
and documentation.
METHODS
load
Given a "file", load it. "file" must contain a valid phrase map.
my $file = 'english.txt';
$loader->load( $file );
This method is used internally by Data::Phrasebook::Generic's "data" method, to initialise the data store.
To utilise the dictionary framework for a Plain Text phrasebook, the idea is to use a directory of files, where the directory is passed via
the "file" argument and the dictionary, the specific name of the file, is passed via the "dictionary" argument.
my $file = '/tmp/phrasebooks';
my $dictionary = 'english.txt';
$loader->load( $file, $dictionary );
get
Returns the phrase stored in the phrasebook, for a given keyword.
my $value = $loader->get( $key );
dicts
Having instantiated the "Data::Phrasebook" object class, and using the "file" attribute as a directory path, the object can return a list
of the current dictionaries available as:
my $pb = Data::Phrasebook->new(
loader => 'Text',
file => '/tmp/phrasebooks',
);
my @dicts = $pb->dicts;
or
my @dicts = $pb->dicts( $path );
keywords
Having instantiated the "Data::Phrasebook" object class, using the "file" and "dict" attributes as required, the object can return a list
of the current keywords available as:
my $pb = Data::Phrasebook->new(
loader => 'Text',
file => '/tmp/phrasebooks',
dict => 'TEST',
);
my @keywords = $pb->keywords;
or
my @keywords = $pb->keywords( $path, $dict );
Note that $path can either be the directory path, where $dict must be the specific file name of the dictionary, or the full path of the
dictionary file.
In the second instance, the function will not load a dictionary, but can be used to interrogate the contents of a known dictionary.
SEE ALSO
Data::Phrasebook.
SUPPORT
Please see the README file.
AUTHOR
Barbie, <barbie@cpan.org>
for Miss Barbell Productions <http://www.missbarbell.co.uk>.
COPYRIGHT AND LICENSE
Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
This module is free software; you can redistribute it and/or
modify it under the Artistic Licence v2.
perl v5.10.1 2010-08-31 Data::Phrasebook::Loader::Text(3pm)