OSX
I have been grinding my teeth on a portion of code. I am building a bash script that edits a html email template. In the template, I have place holders for SED (or whatever program is appropriate) to use as anchors for find and replace, with user defined corresponding html code. The HTML code is pulled from a text file which contains all the different options of code. A simulation is:
(simplified)
If it was a single line, this works fine. But, the html snippet is usually multiple lines, filled with special characters such as:
Is there a better way to approach this? Thanks!
I have a file names 'log.txt' that looks something like this:
#This is a comment
/sbin/iptables -A INPUT -p tcp -s ip.of.a machine --destination-port 21 -j ACCEPT
#This is the comment to read#
/sbin/iptables -A INPUT -p tcp -s ip.of.a.machine --destination-port 21 -j ACCEPT
I would like... (1 Reply)
I'm attempting to insert multiple lines before a line matching a given search pattern. These lines are generated in a separate function and can either be piped in as stdout or read from a temporary file.
I've been able to insert the lines from a file after the pattern using:
sed -i '/pattern/... (2 Replies)
Hi,
I am trying to get lines between the last occurrences of two patterns. I have files that have several occurrences of “Standard” and “Visual”. I will like to get the lines between “Standard” and “Visual” but I only want to retain only the last one e.g.
Standard
Some words
Some words
Some... (4 Replies)
Hello,
I can extract lines in a file, between two strings but only one time.
If there are multiple occurencies, my command show only one block.
Example, monfichier.txt contains :
debut_sect
texte L1
texte L2
texte L3
texte L4
fin_sect
donnees inutiles 1
donnees inutiles 2
... (8 Replies)
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Greetings All,
I would like to find all occurences of a pattern and delete a substring from the all matching lines EXCEPT the first. For example:
1234::group:user1,user2,user3,blah1,blah2,blah3
2222::othergroup:user9,user8
4444::othergroup2:user3,blah,blah,user1
1234::group3:user5,user1
... (11 Replies)
Experts Good day,
I want to filter multiple lines of same error of same day , to only 1 error of each day, the first line from the log.
Here is the file:
May 26 11:29:19 cmihpx02 vmunix: NFS write failed for server cmiauxe1: error 5 (RPC: Timed out)
May 26 11:29:19 cmihpx02 vmunix: NFS... (4 Replies)
hi..
i have a fasta file with the following format
>sequence1
CCGGTTTTCGATTTGGTTTGACT
>sequence2
AAAGTGCCGCCAGGTTTTGAGTGT
>sequence3
AGTGCCGCAGAGTTTGTAGTGT
Now, i want to read alternate line and add "GGGGGGGGGGG" to end of every sequence
Desired output:
>sequence1... (4 Replies)
Hi,
I am running the following:
PASS="username/password"
sqlplus -s << EOF | grep -v "^$"
$PASS
set feedback off
set heading off
set termout off
select name from v\$database ;
exit
EOF
Which gives
ERROR:
ORA-28002: the password will expire within 5 days
PSMP1 (1 Reply)
Discussion started by: newbie_01
1 Replies
LEARN ABOUT DEBIAN
uri::template
URI::Template(3pm) User Contributed Perl Documentation URI::Template(3pm)NAME
URI::Template - Object for handling URI templates (RFC 6570)
SYNOPSIS
use URI::Template;
my $template = URI::Template->new( 'http://example.com/{x}' );
my $uri = $template->process( x => 'y' );
# uri is a URI object with value 'http://example.com/y'
DESCRIPTION
This module provides a wrapper around URI templates as described in RFC 6570: http://tools.ietf.org/html/rfc6570
INSTALLATION
perl Makefile.PL
make
make test
make install
METHODS
new( $template )
Creates a new URI::Template instance with the template passed in as the first parameter.
template
This method returns the original template string.
variables
Returns an array of unique variable names found in the template. NB: they are returned in random order.
expansions
This method returns an list of expansions found in the template. Currently, these are just coderefs. In the future, they will be more
interesting.
process( \%vars )
Given a list of key-value pairs or an array ref of values (for positional substitution), it will URI escape the values and substitute them
in to the template. Returns a URI object.
process_to_string( \%vars )
Processes input like the "process" method, but doesn't inflate the result to a URI object.
AUTHORS
o Brian Cassidy <bricas@cpan.org>
o Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2007-2012 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-05-30 URI::Template(3pm)