Hi All,
I have a text file which contains
*/u01/java/jdk1.7.0_72/jre/bin/java*
*java version "1.7.0_72"*
*Java(TM) SE Runtime Environment (build 1.7.0_72-b14)*
*Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)*
*/u01/java/jdk1.7.0_72/bin/java*
*java version "1.7.0_72"*
*Java(TM) SE Runtime Environment (build 1.7.0_72-b14)*
*Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)*
*/u01/java/jdk1.7.0_65/jre/bin/java*
*java version "1.7.0_65"*
*Java(TM) SE Runtime Environment (build 1.7.0_65-b17)*
*Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)*
I am tryng to seach for a line which contains word java and as well as
java_versions.
I mean if i search only java i need to get
/u01/java/jdk1.7.0_72/jre/bin/java
/u01/java/jdk1.7.0_72/bin/java
and
if search for word java version i need to get
"1.7.0_72"
"1.7.0_65"
Like this can i do it same time for searching
I tried this but it is not working
logfile = "/home/weblogic/javaapp.txt"
java_count = 0
if File.exist? '/home/weblogic/javaapp.txt'
log = Facter::Util::FileRead.read(logfile)
unless log.nil?
log.each_line do |line|
* if line.include?('/java') and line.include?('java version')*
*But it is not returning anything*
*Anyone please help me*
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/261eac6d-a34b-4bf9-90e6-3c602ea8b22b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.