<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need help on AWK Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352427#M683989</link>
    <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I would like to get only directory&lt;BR /&gt;&lt;BR /&gt;Well, that makes it clear, now.&lt;BR /&gt;&lt;BR /&gt;Use the 'dirname' function as VK2COT suggested, or skip spawning this process and let the shell do all the work:&lt;BR /&gt;&lt;BR /&gt;# cat mylist&lt;BR /&gt;/celcomdb17/oradata/Celcom/CDR16.dbf&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K/32K_CCOLL_COUNTERIND44.dbf&lt;BR /&gt;&lt;BR /&gt;# while read DIR&lt;BR /&gt;do&lt;BR /&gt;    echo ${DIR%/*}&lt;BR /&gt;done &amp;lt; mylist&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 05 Feb 2009 12:04:22 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-02-05T12:04:22Z</dc:date>
    <item>
      <title>Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352420#M683982</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Can some one help me.&lt;BR /&gt;&lt;BR /&gt;I have ouput as below:&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom/CDR16.dbf&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K/32K_CCOLL_COUNTERIND44.dbf&lt;BR /&gt;&lt;BR /&gt;I would like to truncate/chop the last field.&lt;BR /&gt;&lt;BR /&gt;The output shout be &lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom&lt;BR /&gt;/celcomdb17/oradata/Celcom&lt;BR /&gt;&lt;BR /&gt;Please assist.&lt;BR /&gt;&lt;BR /&gt;TQ</description>
      <pubDate>Thu, 05 Feb 2009 09:54:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352420#M683982</guid>
      <dc:creator>KAMARULZAMAN HJ ALI</dc:creator>
      <dc:date>2009-02-05T09:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352421#M683983</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ cat RMAN_policy.sh&lt;BR /&gt;#! /bin/ksh&lt;BR /&gt;#&lt;BR /&gt;# set command line variables&lt;BR /&gt;#&lt;BR /&gt;PATH=/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/admincmd:/usr/openv/netbackup/bin/goodies:/usr/openv/netbackup/bin/goodies/support:/usr/openv/volmgr/bin:/usr/openv/volmgr/bin/goodies:/opt/VRTSvxfs/sbin:$PATH&lt;BR /&gt;#USAGE="USAGE: RMAN_policy.sh &lt;FILENAME&gt; "&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#shift `expr $OPTIND - 1`&lt;BR /&gt;&lt;BR /&gt;#INSTANCE=$1&lt;BR /&gt;#SERVER=$2&lt;BR /&gt;#PRIORITY=$3&lt;BR /&gt;#VPOOL=$4&lt;BR /&gt;#BPATH=$5&lt;BR /&gt;#OSV=$6&lt;BR /&gt;&lt;BR /&gt;#PASSES=`wc -l $1 | awk '{ print $1 }'`&lt;BR /&gt;#PASSNO=0&lt;BR /&gt;&lt;BR /&gt;function while_read_LINE&lt;BR /&gt;{&lt;BR /&gt;cat $1 | while read LINE&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;echo "$LINE"&lt;BR /&gt;&lt;BR /&gt;INSTANCE=`echo "$LINE" | awk '{ print $1 }'`&lt;BR /&gt;SERVER=`echo "$LINE" | awk '{ print $2 }'`&lt;BR /&gt;PRIORITY=`echo "$LINE" | awk '{ print $3 }'`&lt;BR /&gt;VPOOL=`echo "$LINE" | awk '{ print $4 }'`&lt;BR /&gt;BPATH=`echo "$LINE" | awk '{ print $5 }'`&lt;BR /&gt;OSV=`echo "$LINE" | awk '{ print $6 }'`&lt;BR /&gt;&lt;BR /&gt;echo "$INSTANCE"&lt;BR /&gt;echo "$SERVER"&lt;BR /&gt;echo "$PRIORITY"&lt;BR /&gt;echo "$VPOOL"&lt;BR /&gt;echo "$BPATH"&lt;BR /&gt;echo "$OSV"&lt;BR /&gt;&lt;BR /&gt;echo bppolicynew ora_"$INSTANCE"&lt;BR /&gt;echo bpplinfo ora_"$INSTANCE" -set -ut -active -blkincr 0 -collect_tir_info 0 -compress 0 -crossmp 1 -disaster 0 -encrypt 0 -follownfs 0 -multiple_streams 1 -policyjobs 0 -pool "$VPOOL" -priority "$PRIORITY" -pt Standard -residence foo -chkpt 1 -chkpt_intrvl 30&lt;BR /&gt;echo bpplsched ora_"$INSTANCE" -add Full&lt;BR /&gt;echo bpplschedrep ora_"$INSTANCE" Full -cal 0 -freq 86400 -mpxmax 1 -rl 5 -st FULL&lt;BR /&gt;echo bpplinclude ora_"$INSTANCE" -add "$BPATH"/*&lt;BR /&gt;echo bpplclients ora_"$INSTANCE" -add "$SERVER" Solaris "$OSV"&lt;BR /&gt;&lt;BR /&gt;#PASSNO=`expr $PASSNO + 1`&lt;BR /&gt;&lt;BR /&gt;#echo END PASS "$PASSNO"&lt;BR /&gt;&lt;BR /&gt;#INSTANCE=$INSTANCE; shift 6&lt;BR /&gt;#SERVER=$SERVER; shift 6&lt;BR /&gt;#PRIORITY=$PRIORITY; shift 6&lt;BR /&gt;#VPOOL=$VPOOL; shift 6&lt;BR /&gt;#BPATH=$BPATH; shift 6&lt;BR /&gt;#OSV=$OSV; shift 6&lt;BR /&gt;done&lt;BR /&gt;}&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;From:&lt;BR /&gt;&lt;A href="http://www.unix.com/shell-programming-scripting/85239-parsing-file-line.html" target="_blank"&gt;http://www.unix.com/shell-programming-scripting/85239-parsing-file-line.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Or:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://cdunix.blogspot.com/2008/09/parsing-connectdirect-stats-part-2_26.html" target="_blank"&gt;http://cdunix.blogspot.com/2008/09/parsing-connectdirect-stats-part-2_26.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;awk is great for breaking up strings using field separators.&lt;BR /&gt;/ is a special character, requires a little more work.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/FILENAME&gt;</description>
      <pubDate>Thu, 05 Feb 2009 10:14:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352421#M683983</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-02-05T10:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352422#M683984</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I would like to truncate/chop the last field&lt;BR /&gt;&lt;BR /&gt;# awk -F/ '{OFS="/";print $1,$2,$3}' file&lt;BR /&gt;&lt;BR /&gt;...would yield the output you requested.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 05 Feb 2009 10:17:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352422#M683984</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-05T10:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352423#M683985</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am not sure I undersxtand what you want.&lt;BR /&gt;&lt;BR /&gt;If you truncate the last "field" from&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K/32K_CCOLL_COUNTERIND44.dbf&lt;BR /&gt;&lt;BR /&gt;... it should be:&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K&lt;BR /&gt;&lt;BR /&gt;... not as you said in the original message.&lt;BR /&gt;&lt;BR /&gt;So, if you really want the last&lt;BR /&gt;"slash-separated" field to be removed,&lt;BR /&gt;it is as simple as:&lt;BR /&gt;&lt;BR /&gt;for i in /celcomdb17/oradata/Celcom/CDR16.dbf &lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K/32K_CCOLL_COUNTERIND44.dbf&lt;BR /&gt;do&lt;BR /&gt;   dirname $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The result is:&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K&lt;BR /&gt;&lt;BR /&gt;Please clarify your requirements.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Thu, 05 Feb 2009 10:23:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352423#M683985</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2009-02-05T10:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352424#M683986</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Second try:&lt;BR /&gt;&lt;BR /&gt;[root@bersheva ~]# F1="/steve/direname1/file.dbf"&lt;BR /&gt;[root@bersheva ~]# d1=$(echo $F1 | awk -F "/" '{ print $1}')&lt;BR /&gt;[root@bersheva ~]# echo $d1&lt;BR /&gt;&lt;BR /&gt;[root@bersheva ~]# d1=$(echo $F1 | awk -F "/" '{ print $1 }')&lt;BR /&gt;[root@bersheva ~]# echo $d1&lt;BR /&gt;&lt;BR /&gt;[root@bersheva ~]# d1=$(echo $F1 | awk -F "/" '{ print $2 }')&lt;BR /&gt;[root@bersheva ~]# echo $d1&lt;BR /&gt;&lt;BR /&gt;You can go forward from here.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 05 Feb 2009 10:24:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352424#M683986</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-02-05T10:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352425#M683987</link>
      <description>TQ for the reply.&lt;BR /&gt;&lt;BR /&gt;Appology my typo.&lt;BR /&gt;&lt;BR /&gt;Actually output should be :&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K&lt;BR /&gt;&lt;BR /&gt;The OFS "/" length is varried.&lt;BR /&gt;I would like to get only directory.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;-Kamarul&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Feb 2009 11:46:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352425#M683987</guid>
      <dc:creator>KAMARULZAMAN HJ ALI</dc:creator>
      <dc:date>2009-02-05T11:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352426#M683988</link>
      <description>If you only want the directory use VK2COT's method above.&lt;BR /&gt;&lt;BR /&gt;See "man dirname" for more information.</description>
      <pubDate>Thu, 05 Feb 2009 11:52:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352426#M683988</guid>
      <dc:creator>bright image</dc:creator>
      <dc:date>2009-02-05T11:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352427#M683989</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I would like to get only directory&lt;BR /&gt;&lt;BR /&gt;Well, that makes it clear, now.&lt;BR /&gt;&lt;BR /&gt;Use the 'dirname' function as VK2COT suggested, or skip spawning this process and let the shell do all the work:&lt;BR /&gt;&lt;BR /&gt;# cat mylist&lt;BR /&gt;/celcomdb17/oradata/Celcom/CDR16.dbf&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K/32K_CCOLL_COUNTERIND44.dbf&lt;BR /&gt;&lt;BR /&gt;# while read DIR&lt;BR /&gt;do&lt;BR /&gt;    echo ${DIR%/*}&lt;BR /&gt;done &amp;lt; mylist&lt;BR /&gt;&lt;BR /&gt;/celcomdb17/oradata/Celcom&lt;BR /&gt;/celcomdb17/oradata/Celcom/INDEX_32K&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:04:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352427#M683989</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-05T12:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352428#M683990</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;based on Mr. Ferguson's first suggestion:&lt;BR /&gt;&lt;BR /&gt;$ awk -F/ '{OFS="/"; $NF="";print substr($0,1,length($0)-1)}' &amp;lt; yourinputfile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Thu, 05 Feb 2009 12:10:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352428#M683990</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2009-02-05T12:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on AWK Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352429#M683991</link>
      <description>Hi TQ,&lt;BR /&gt;dirname is the command for you:&lt;BR /&gt;dirname /celcomdb17/oradata/Celcom/CDR16.dbf&lt;BR /&gt;/celcomdb17/oradata/Celcom/&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Fri, 06 Feb 2009 09:37:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/need-help-on-awk-script/m-p/4352429#M683991</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2009-02-06T09:37:55Z</dc:date>
    </item>
  </channel>
</rss>

