08-07-2003
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
IN a file I need to check for 3 patterns if all the 3 patterns are in the file. I need to send out an email. All this needs to be done in korn shell script. Please advise. (1 Reply)
Discussion started by: saibsk
1 Replies
2. Shell Programming and Scripting
Hi,
Would anyone be able to suggest on this shell script query? =)
From the contents of the 2 sample files below, if both files' 1st fields matched (ex: XYZ1234=XYZ1234), I want to append the 4th field (semi-colon delimited) from File2 to the end of that line in File1.
If no match found, then... (8 Replies)
Discussion started by: gholdbhurg
8 Replies
3. Shell Programming and Scripting
I'm looking for a way to match a particular string in another string and if a match is found execute some command.
I found the case statement can be used like this;
case word in
)
command ;; ] ...
esac
If my string to find is say "foo" in the string $mystring... (1 Reply)
Discussion started by: paulobrad
1 Replies
4. Shell Programming and Scripting
Hi,
I need to create a shell script through which i need to populate email addresses in email columns of database table in mysql. Let say if email contains yahoo, hotmail, gtalk than email addresses need to move in their respective columns.
# !/bin/sh
yim="example@yahoo.com"... (3 Replies)
Discussion started by: mirfan
3 Replies
5. Shell Programming and Scripting
Hi,
I am using following command to extract string from a file. String will be after last / (slash).
awk -F\ / '{print $NF}' $FILE
but while appending the output in file in script, it dosent work. File created but of zero size... can anyone please help
`awk -F\\\/ '{print $NF}' $FILE` >... (3 Replies)
Discussion started by: Deei
3 Replies
6. Shell Programming and Scripting
Dear experts,
I have an epoch time input file such as : -
1302451209564
1302483698948
1302485231072
1302490805383
1302519244700
1302492787481
1302505299145
1302506557022
1302532112140
1302501033105
1302511536485
1302512669550
I need the epoch time above to be converted into real... (4 Replies)
Discussion started by: aismann
4 Replies
7. Solaris
On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help
here is what i get when i check for system date
infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date
Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies
8. Shell Programming and Scripting
hello all,
I have requirement to identify similar records matching about 80% to 90%.I have to black list customers with multiple accounts.
The data is in the Oracle Database, but is there any way I can get the data into flat file and compare the strings and fetch similar matching records?
... (2 Replies)
Discussion started by: kashik786
2 Replies
9. Shell Programming and Scripting
Hi
I want to find a line in a file which contains a word and replace the patterns.
Sample file content temp.xml
====================
<applications>
<application>
Name="FirstService"
location="http://my.website.selected/myfirstService/V1.0/myfirst.war"
... (1 Reply)
Discussion started by: sakthi.99it
1 Replies
10. Shell Programming and Scripting
Hi all,
Is Perl included by default in Ubuntu? I'm trying to write a program using as few languages as possible, and since I'm using a few Perl one-liners to do non-greedy matching, it's considered another language, and this is a bad thing.
Basically, I'm using a Perl one-liner to grab XML... (3 Replies)
Discussion started by: Zel2008
3 Replies
LEARN ABOUT DEBIAN
text::micromason::texttemplate
MicroMason::TextTemplate(3pm) User Contributed Perl Documentation MicroMason::TextTemplate(3pm)
NAME
Text::MicroMason::TextTemplate - Alternate Syntax like Text::Template
SYNOPSIS
Instead of using this class directly, pass its name to be mixed in:
use Text::MicroMason;
my $mason = Text::MicroMason::Base->new( -TextTemplate );
Use the standard compile and execute methods to parse and evalute templates:
print $mason->compile( text=>$template )->( @%args );
print $mason->execute( text=>$template, @args );
Text::Template provides a syntax to mix Perl into a text template:
{ my $hour = (localtime)[2];
my $daypart = ( $hour > 11 ) ? 'afternoon' : 'morning';
'' }
Good { $daypart }, { $name }!
DESCRIPTION
This mixin class overrides several methods to allow MicroMason to emulate the template syntax and some of the other features of
Text::Template.
Compatibility with Text::Template
This is not a drop-in replacement for Text::Template, as the Perl calling interface is quite different, but it should be able to process
most existing templates without major changes.
This should allow current Text::Template users to take advantage of MicroMason's one-time compilation feature, which in theory could be
faster than Text::Template's repeated evals for each expression. (No benchmarking yet.)
Contributed patches to more closely support the syntax of Text::Template documents would be welcomed by the author.
Template Syntax
The following elements are recognized by the TextTemplate lexer:
o literal_text
Anything not specifically parsed by the below rule is interpreted as literal text.
o { perl_expr }
A Perl expression to be interpolated into the result.
Good { (localtime)[2]>11 ? 'afternoon' : 'morning' }.
The block may span multiple lines and is scoped inside a "do" block, so it may contain multiple Perl statements and it need not end
with a semicolon.
Good { my $h = (localtime)[2]; $h > 11 ? 'afternoon'
: 'morning' }.
To make a block silent, use an empty string as the final expression in the block.
{ warn "Interpreting template"; '' }
Hello there.
Although the blocks are not in the same a lexical scope, you can use local variables defined in one block in another:
{ $phase = (localtime)[2]>11 ? 'afternoon' : 'morning'; '' }
Good { $phrase }.
Argument Passing
Like Text::Template, this package clobbers a target namespace to pass in template arguments as package variables. For example, if you pass
in an argument list of "foo => 23", it will set the variable $foo in your package.
The strict pragma is disabled to facilitate these variable references.
Internally, this module inherits this functionality from the PassVariables mixin. If you are using the TextTemplate mixin, do not also
specify the PassVariables mixin or it will be included twice. For more information, see Text::MicroMason::PassVariables.
Supported Attributes
package
Target package namespace.
Private Methods
prepare()
If a package has not been specified, this method generates a new package namespace to use only for compilation of a single template.
lex()
Lexer for matched braces - produces only text and expr tokens. Uses Text::Balanced.
SEE ALSO
The interface being emulated is described in Text::Template.
For an overview of this templating framework, see Text::MicroMason.
This is a mixin class intended for use with Text::MicroMason::Base.
For distribution, installation, support, copyright and license information, see Text::MicroMason::Docs::ReadMe.
perl v5.10.1 2007-01-29 MicroMason::TextTemplate(3pm)