I want to test a var, $inputPin to see if is 3 digits in a row or not in a Bash script.
I am getting stuck on the regex to do this.
And the equality test if it is in an if statement as below?
-ne is for comparing numbers
But I guess it would be != in this case
Simple for someone I'm sure. But I am stumped.
hi sirs
can u tell the difference between /var/log/syslogs and /var/adm/messages
in my working place i am having two servers.
in one servers messages file is empty and syslog file is going on increasing..
and in another servers message file is going on increasing but syslog file is... (2 Replies)
Hi Folks
Probably an easy one here but how do I get a sequence to get used as mentioned. For example in the following I want to automatically create files that have a 2 digit number at the end of their names:
m@pyhead:~$ for x in $(seq 00 10); do touch file_$x; done
m@pyhead:~$ ls file*... (2 Replies)
Hi all,
I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...).
I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message.
Is there any way to simply get a return code... (3 Replies)
Hello all! I've looked all over the internet and this site and have come up a loss with an easy way to make a bash script to do what I want to do. I have a file with a naming convention as follows:
2012-01-18 string of words here 123.jpg
2012-01-18 string of words here 1234.jpg
2012-01-18... (2 Replies)
Hi,
I have a requirement where I have to remove duplicates from a file based on the first 8 chars (It is fixed width file of 10 chars length) and whenever a duplicate row is found, its original row's last 2 chars should be updated to all 0's.
I thought of using
sort -u -k 1.1,1.8... (4 Replies)
i try to find way to make string concatenation in csh ( sorry this is what i have )
so i found out i can't do :
set string_buff = ""
foreach line("`cat $source_dir/$f`")
$string_buff = string_buff $line
end
how can i do string concatenation? (1 Reply)
Hi ALL,
We have requirement in a file, i have multiple rows.
Example below:
Input file rows
01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212
01,1,102319,0,1,80,20,U,1,241,00000059420000006021
I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Hi All ,
I am having an input file as stated below
5728 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r03_q_reg_20_/Q 011
611 U_TOP_LOGIC/U_CM0P/core/u_cortexm0plus/u_top/u_sys/u_core/r04_q_reg_20_/Q 011
3486... (4 Replies)
Discussion started by: kshitij
4 Replies
LEARN ABOUT DEBIAN
test::xml::simple
Test::XML::Simple(3pm) User Contributed Perl Documentation Test::XML::Simple(3pm)NAME
Test::XML::Simple - easy testing for XML
SYNOPSIS
use Test::XML::Simple tests=>5;
xml_valid $xml, "Is valid XML";
xml_node $xml, "/xpath/expression", "specified xpath node is present";
xml_is, $xml, '/xpath/expr', "expected value", "specified text present";
xml_like, $xml, '/xpath/expr', qr/expected/, "regex text present";
xml_is_deeply, $xml, '/xpath/expr', $xml2, "structure and contents match";
# Not yet implemented:
# xml_like_deeply would be nice too...
DESCRIPTION
"Test::XML::Simple" is a very basic class for testing XML. It uses the XPath syntax to locate nodes within the XML. You can also check all
or part of the structure vs. an XML fragment.
TEST ROUTINES
xml_valid $xml, 'test description'
Pass an XML file or fragment to this test; it succeeds if the XML (fragment) is valid.
xml_node $xml, $xpath, 'test description'
Checks the supplied XML to see if the node described by the supplied XPath expression is present. Test fails if it is not present.
xml_is_long $xml, $xpath, $value, 'test description'
Finds the node corresponding to the supplied XPath expression and compares it to the supplied value. Succeeds if the two values match.
Uses Test::More's "is" function to do the comparison.
xml_is $xml, $xpath, $value, 'test description'
Finds the node corresponding to the supplied XPath expression and compares it to the supplied value. Succeeds if the two values match.
Uses Test::LongString's "is_string" function to do the test.
xml_like_long $xml, $xpath, $regex, 'test description'
Find the XML corresponding to the the XPath expression and check it against the supplied regular expression. Succeeds if they match. Uses
Test::More's "like" function to do the comparison.
xml_like $xml, $xpath, $regex, 'test description'
Find the XML corresponding to the the XPath expression and check it against the supplied regular expression. Succeeds if they match. Uses
Test::LongString's "like_string" function to do the test.
xml_is_deeply_long $xml, $xpath, $xml2, 'test description'
Find the piece of XML corresponding to the XPath expression, and compare its structure and contents to the second XML (fragment) supplied.
Succeeds if they match in structure and content. Uses Test::More's "is" function to do the comparison.
xml_is_deeply $xml, $xpath, $xml2, 'test description'
Find the piece of XML corresponding to the XPath expression, and compare its structure and contents to the second XML (fragment) supplied.
Succeeds if they match in structure and content. Uses Test::LongString's "is_string" function to do the test.
AUTHOR
Joe McMahon, <mcmahon@cpan.org>
LICENSE
Copyright (c) 2005 by Yahoo! and Joe McMahon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or,
at your option, any later version of Perl 5 you may have available.
SEE ALSO
XML::XPath, Test::More, Test::Builder.
perl v5.14.2 2012-06-05 Test::XML::Simple(3pm)