Hi folks,
I need to find the following value:
First,I need to find the starting section by finding the line:
<process-type id="OC4J_RiGHTv_${SCHEMA_NAME}" module-id="OC4J">
Second,under this line I need to find the following line:
<port id="rmi" range="3765-3776"/>
And third,from this line... (4 Replies)
Hi All
I have a script which has produced a list, I have used 'sed' to number my list, but i want to list at end of line with the first line starting at zero (0) and brackets round it
ie
My List i want
Hello (0)
this (1)
day (2)
can (3)
be (4)
sed '/./=' filename | sed '/./N; s/\n/) /'... (5 Replies)
Hi
I want to find whether the argument passed to my script ends in a number or not. Like, I want to find out if the argument is of the form: xyzwpq123 or just of the form xyzwpq.
Can someone please help me!?
Thanks (2 Replies)
how to list all files in current directory whose second character is a digit.
i guess i hav to use grep command + ls for this. but dont know how to use? (6 Replies)
Hi Everyone,
a.txt
1272904667;1272904737;1
1272904747;1272904819;1
1272904810;1272904857;1
1272904889;1272904926;1
1272905399;1272905406;1
1272905411;1272905422;1
if i want to get the record, when the a.txt 1st field is between 1272904749 and 1272905399, any simple way by using awk,... (1 Reply)
I have to write a c program which takes a 3 digit number n and calculates the value of (2^n)+1 and then determines the number is prime or not.
I have tried to first calculate the value of 2^n and then adding one to it and then apply the logic of prime number.
but the ultimate problem is that... (7 Replies)
how can i list all files in my home directory that have a 4 digit id number, the line number where the id is located and the id itself not printing the entire line? (5 Replies)
list all file whose 3rd char is digit (or Nth position is digit)
what will be the required command? (5 Replies)
Discussion started by: rahul
5 Replies
LEARN ABOUT MOJAVE
bytes5.18
bytes(3pm) Perl Programmers Reference Guide bytes(3pm)NAME
bytes - Perl pragma to force byte semantics rather than character semantics
NOTICE
This pragma reflects early attempts to incorporate Unicode into perl and has since been superseded. It breaks encapsulation (i.e. it
exposes the innards of how the perl executable currently happens to store a string), and use of this module for anything other than
debugging purposes is strongly discouraged. If you feel that the functions here within might be useful for your application, this possibly
indicates a mismatch between your mental model of Perl Unicode and the current reality. In that case, you may wish to read some of the perl
Unicode documentation: perluniintro, perlunitut, perlunifaq and perlunicode.
SYNOPSIS
use bytes;
... chr(...); # or bytes::chr
... index(...); # or bytes::index
... length(...); # or bytes::length
... ord(...); # or bytes::ord
... rindex(...); # or bytes::rindex
... substr(...); # or bytes::substr
no bytes;
DESCRIPTION
The "use bytes" pragma disables character semantics for the rest of the lexical scope in which it appears. "no bytes" can be used to
reverse the effect of "use bytes" within the current lexical scope.
Perl normally assumes character semantics in the presence of character data (i.e. data that has come from a source that has been marked as
being of a particular character encoding). When "use bytes" is in effect, the encoding is temporarily ignored, and each string is treated
as a series of bytes.
As an example, when Perl sees "$x = chr(400)", it encodes the character in UTF-8 and stores it in $x. Then it is marked as character data,
so, for instance, "length $x" returns 1. However, in the scope of the "bytes" pragma, $x is treated as a series of bytes - the bytes that
make up the UTF8 encoding - and "length $x" returns 2:
$x = chr(400);
print "Length is ", length $x, "
"; # "Length is 1"
printf "Contents are %vd
", $x; # "Contents are 400"
{
use bytes; # or "require bytes; bytes::length()"
print "Length is ", length $x, "
"; # "Length is 2"
printf "Contents are %vd
", $x; # "Contents are 198.144"
}
chr(), ord(), substr(), index() and rindex() behave similarly.
For more on the implications and differences between character semantics and byte semantics, see perluniintro and perlunicode.
LIMITATIONS
bytes::substr() does not work as an lvalue().
SEE ALSO
perluniintro, perlunicode, utf8
perl v5.18.2 2013-11-04 bytes(3pm)