Trying to write a sed command that applies multiple replacements to a specific address. Need a second pair of eyes I guess cause my syntax appears to be correct (obviously not though) I am getting an error. Any Help would be appreciated! Thanks in advance.
sed -f foo envOracle
sed: Function... (2 Replies)
I'm attempting to append a line after a specific address with sed. If I type in the address eg.3 then it will append after the third line. I can't get it to work with a variable though. Does anyone know how to do it please?
sed '/3/a\
text' filename :)
sed '/\$address/a\
text' filename... (8 Replies)
I would like to grab only designates and the IP address next to it. I can also live with client-ip=xx.xx.xx.xx
Any help is much appreciated.
line to grep or sed:
Received-SPF: pass (google.com: domain of support@uhb-hosting.de designates 80.67.28.12 as permitted sender)... (7 Replies)
Hi Folks,
In my program, I have a variable which consists of multiple lines. i need to use each line as an input. My intention is to extract the email address of the user in each line and use it to process further.
The email address could be anywhere in the whole line. But there will be only... (5 Replies)
Hi,
In a file, I have several time
<IP>232.0.1.164</IP>
...
<IP>232.0.1.135</IP>
I need to replace all the random IP addresses , by 239.0.0.1 and 239.0.0.2 , alternatively.
I try this
grep "<IP>" tsp.xml | awk '{if(NR % 2)print $0}' | cut -d"<" -f2 | cut -d">" -f2 ... (3 Replies)
in Solaris 10 I am able to run:
find . -type f -name "copy*" exec grep example.com {} \;
and I get results.
but when I try to find and sed:
find . -type f -name "copy*" exec sed -e 's/user@example\.com/user2@example\.com' {} \;
the command executes correctly but doesn't change... (6 Replies)
Hi,
I have to modify the 2nd and 3rd octet of the IP address through awk/sed.
For Example:
Given IP is : 10.205.22.254, it should be modified as 10.105.100.254 through awk/sed.
Kindly help me on this and let me know if you have any questions.
Thanks in advances. (2 Replies)
I am trying to grep for a particular text (Do action on cell BL330) in a text file(sample.gz) which is searched in the content filtered by date+timestamp (2016-09-14 01:09:56,796 to 2016-09-15 04:10:29,719) on a remote machine and finally write the output into a output file on a local machine.
... (23 Replies)
I am trying to add word in last of particular line.
the same command syntex is running on prompt. but in bash script give error."sed: -e expression #1, char 20: unterminated address regex"
Please help.
for i in `cat servername`;
do
ssh -q -t root@$i sed -i '/simple_allow_groups =/s/$/,... (4 Replies)
Discussion started by: yash_message
4 Replies
LEARN ABOUT DEBIAN
tree::node
Node(3pm) User Contributed Perl Documentation Node(3pm)NAME
Tree::RedBlack::Node - Node class for Perl implementation of Red/Black tree
SYNOPSIS
use Tree::RedBlack; my $t = new Tree::RedBlack; $t->insert(3, 'dog'); my $node = $t->node(3); $animal = $node->val;
DESCRIPTION
A Tree::RedBlack::Node object supports the following methods:
key ()
Key of the node. This is what the nodes are sorted by in the tree.
val ($)
Value of the node. Can be any perl scalar, so it could be a hash-ref, f'rinstance. This can be set directly.
color ()
Color of the node. 1 for "red", 0 or undef for "black".
parent ()
Parent node of this one. Returns undef for root node.
left ()
Left child node of this one. Returns undef for leaf nodes.
right ()
Right child node of this one. Returns undef for leaf nodes.
min ()
Returns the node with the minimal key starting from this node.
max ()
Returns the node with the maximal key starting from this node.
successor ()
Returns the node with the smallest key larger than this node's key, or this node if it is the node with the maximal key.
predecessor ()
Similar to successor. WARNING: NOT YET IMPLEMENTED!!
You can use these methods to write utility routines for actions on red/black trees. For instance, here's a routine which writes a tree out
to disk, putting the byte offsets of the left and right child records in the record for each node.
sub dump {
my($node, $fh) = @_;
my($left, $right);
my $pos = tell $fh;
print $fh $node->color ? 'R' : 'B';
seek($fh, 8, 1);
print $fh $node->val;
if ($node->left) {
$left = dump($node->left,$fh);
}
if ($node->right) {
$right = dump($node->right,$fh);
}
my $end = tell $fh;
seek($fh, $pos+1, 0);
print $fh pack('NN', $left, $right);
seek($fh, $end, 0);
$pos;
}
You would call it like this:
my $t = new Tree::RedBlack;
...
open(FILE, ">tree.dump");
dump($t->root,*FILE);
close FILE;
As another example, here's a simple routine to print a human-readable dump of the tree:
sub pretty_print {
my($node, $fh, $lvl) = @_;
if ($node->right) {
pretty_print($node->right, $fh, $lvl+1);
}
print $fh ' 'x($lvl*3),'[', $node->color ? 'R' : 'B', ']', $node->key, "
";
if ($node->left) {
pretty_print($this->left, $fh, $lvl+1);
}
}
A cleaner way of doing this kind of thing is probably to allow sub-classing of Tree::RedBlack::Node, and then allow the Tree::RedBlack
constructor to take an argument saying what class of node it should be made up out of. Hmmm...
AUTHOR
Benjamin Holzman <bholzman@earthlink.net>
SEE ALSO
Tree::RedBlack
perl v5.10.0 2008-07-31 Node(3pm)