Tuesday, March 28, 2017

awk substring function

To search for couple of strings in a single line, from a file.


cat somefile.txt |  awk 'substr($0,73,3)=="ABC" && substr($0,177,4)=="WXYZ" {print}'


Here we are searching for the strings in position 70-73 for the 1st string and for the 2nd string in 170-174 position in the same line.

pargs - full details of a process

To get full details of a process, issue pargs command

$pargs -l 15549
/u01/app/oracle/apps/tech_st/10.1.3/appsutil/jdk/bin/java '-DCLIENT_PROCESSID=15549'
-server
-verbose:gc
-Xmx512M
-Xms128M '
-XX:MaxPermSize=160M' '
-XX:NewRatio=2' '
-XX:+PrintGCTimeStamps' '
-XX:+UseTLAB' '
-XX:+UseParallelGC' '
-XX:ParallelGCThreads=2'
-Dcom.sun.management.jmxremote '
-Djava.security.policy=/u01/app/oracle/apps/tech_st/10.1.3/j2ee/oacore/config/java2.policy' '
-Djava.awt.headless=true' '
-Dhttp.webdir.enable=false' '
-Doracle.security.jazn.config=/u01/app/oracle/inst/apps/DEV_orasys/ora/10.1.3/j2ee/oacore/config/jazn.xml' '
-Dhttp.cookie.ignoreCommaInCookiesNamed=X_NoMatchingCookies' '
-Doracle.ons.oraclehome=/u01/app/oracle/apps/tech_st/10.1.3' '
-Doracle.home=/u01/app/oracle/apps/tech_st/10.1.3' '
-Doracle.ons.oracleconfighome=/u01/app/oracle/inst/apps/DEV_orasys/ora/10.1.3' '
-Doracle.ons.clustername=default' '
-Doracle.ons.instancename=DEV_orasys.orasys.devglobalpay.com' '
-Dopmn.compatible=904' '
-Doracle.ons.indexid=oacore.default_group.1' '
-Doracle.ons.numprocs=1' '
-Doracle.ons.uid=1382292201' '
-Doracle.oc4j.groupname=default_group' '
-Doracle.oc4j.instancename=oacore' '
-Doracle.oc4j.islandname=default_group' '
-Doracle.opmn.routingid=g_rt_id' '
-DOPMN=true' -jar oc4j.jar
-config /u01/app/oracle/inst/apps/DEV_orasys/ora/10.1.3/j2ee/oacore/config/server.xml
-properties
-out /u01/app/oracle/inst/apps/DEV_orasys/logs/ora/10.1.3/opmn/oacorestd.out
-err /u01/app/oracle/inst/apps/DEV_orasys/logs/ora/10.1.3/opmn/oacorestd.err
-ports default-web-site:ajp:21515,rmi:20015,jms:23015