I wish to compute the number of dot chars in a string.
Example:
VAR="aaaa.bbbbb.cccc"
I try the shortest command to solve this test.
Thanks in advance for your help.
Regards,
Giovanni (7 Replies)
This is actually a c++ question...
Basically I am creating a program that asks for five characters. I have a dictionary file containing tons of words no long than five letters long, on a seperate line. I want to be able to take the five inputted letters and compare them to the words in the file... (3 Replies)
i have a script that reads a plain text file. (its a ksh, and i can use bash also)
each line of the file is a fullpath of a file. that makes the list huge.
i need to add a functionalitie to that script, i have to be able to add
/usr/* or /usr/ and with that reference all the files and folders... (6 Replies)
I am stumped! I need to parse an input parameter to a script that has the form '-Ort'. I basically need 'O', 'r' and 't', i.e. the individual characters in the string parsed.
Since there are no delimiters, I don't know how awk could do this. Can someone tell how to do this, this should be a... (5 Replies)
To find out number of "|" symbol is available in file:
Input:
a|b|c|d|z
Ouput:
4
I am using below set of commands,It is working... Anybody have anyother solution using sed / awk.
cnt=`wc -c <1.txt`
cnt1=`tr -d "|" <1.txt >c.dat`
cnt2=`wc -c <c.dat`
outp=`expr $cnt... (19 Replies)
Hi guys, I am stuck up in a situation. I have a SUN box with certain logs which I need to parse to draw a report using Perl.
Now, when I load the text file using a perl degugger to see how the text looks like when the first line of the log file is read in a variable. below is the snapshot of... (2 Replies)
I am using ifstream to open a file using
std::fstream::open
void open ( const char * filename, ios_base::openmode mode = ios_base::in );
However I want to use a string instead of a char* as follows but having a problem on how to do this
string val_ifmodl = “fred.modl”
ifstream ifs_modl;... (2 Replies)
hello
how can i cont number of char with loop coomand?
i dont want to use wc or other special command
the script should check all word's char. one by one
also a counter can handle the number
As noted in other threads started today. This is not the correct forum for homework assignments. ... (2 Replies)
I need to write a BASH script that takes a 2 character string and removes the second character if it is not a digit e.g.
If the string is numberical value >9 e.g. string1 = '34' then leave string1 = '34'.
However if the string is <10 e.g. string1 = '3X' then remove the second char (which... (7 Replies)
Discussion started by: millsy5
7 Replies
LEARN ABOUT DEBIAN
log::agent::message
Agent::Message(3pm) User Contributed Perl Documentation Agent::Message(3pm)NAME
Log::Agent::Message - a log message
SYNOPSIS
require Log::Agent::Message;
my $msg = Log::Agent::Message->make("string");
$msg->prepend("string");
$msg->append("string");
my $copy = $msg->clone;
print "Message is $msg
"; # overloaded stringification
DESCRIPTION
The Log::Agent::Message class represents an original log message (a string) to which one may prepend or append other strings, but with the
special property that prepended strings aggregate themselves in FIFO order, whilst appended strings aggregate themselves in LIFO order,
which is counter-intuitive at first sight.
In plain words, this means that the last routine that prepends something to the message will get its prepended string right next to the
original string, regardless of what could have been prepended already. The behaviour is symetric for appending.
INTERFACE
The following routines are available:
append($str)
Append suppled string $str to the original string (given at creation time), at the head of all existing appended strings.
append_last($str)
Append suppled string $str to the original string (given at creation time), at the tail of all existing appended strings.
clone
Clone the message. This is not a shallow clone, because the list of prepended and appended strings is recreated. However it is not a
deep clone, because the items held in those lists are merely copied (this would matter only when other objects with overloaded
stringification routines were supplied to prepend() and append(), which is not the case today in the basic Log::Agent framework).
make($string)
This is the creation routine.
prepend($str)
Prepend supplied string $str to the original string (given at creation time), at the tail of all existing prepended strings.
prepend_first($str)
Prepend supplied string $str to the original string (given at creation time), at the head of all existing prepended strings.
stringify
This is the overloaded "" operator, which returns the complete string composed of all the prepended strings, the original string, and
all the appended strings.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO Log::Agent(3).
perl v5.10.0 2002-03-09 Agent::Message(3pm)