<?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: scripting ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629308#M676316</link>
    <description>&lt;!--!*#--&gt;The attached script will provide all the details you need. Run it as root with -v:&lt;BR /&gt; &lt;BR /&gt;bdfmegs -v&lt;BR /&gt; &lt;BR /&gt;To see all the other options, use -h or -?:&lt;BR /&gt; &lt;BR /&gt;bdfmegs -h&lt;BR /&gt; &lt;BR /&gt;Usage:  bdfmegs [ -cghlNPpqstuVv ] [ &lt;FILE&gt; ]&lt;BR /&gt;  where:&lt;BR /&gt;    -c # = Sort on column #&lt;BR /&gt;    -d = Toggle divisor (1000 or 1024, current=1000)&lt;BR /&gt;    -g = show gigabytes, otherwise megabytes&lt;BR /&gt;    -h = Usage (return code=0, Usage to stdout)&lt;BR /&gt;    -l = local (no NFS)&lt;BR /&gt;    -M &lt;MOUNTPOINTS&gt; = skip (grep -v) mountpoints&lt;BR /&gt;    -N &lt;VGNAMES&gt; = skip one or more volume groups&lt;BR /&gt;        Repeat -N or use commas: -N vg10,vg24&lt;BR /&gt;    -p ## = highlight % -ge ##&lt;BR /&gt;    -P ## = show only % -ge ##&lt;BR /&gt;    -q = suppress header line and no char enhancements&lt;BR /&gt;    -s = summarize total, used and available&lt;BR /&gt;    -t &lt;FS&gt; = specifc filesystem: (hfs vxfs nfs cdfs cifs autofs DevFS)&lt;BR /&gt;    -u = usage (return code=0, Usage to stdout)&lt;BR /&gt;    -v = verbose (type, version, largefiles)&lt;BR /&gt;         (version info needs read permission for mountpoint)&lt;BR /&gt;    -V &lt;VGNAME&gt; = select one or more volume groups&lt;BR /&gt;       Repeat -V or use commas: -V vg00,vg01&lt;BR /&gt;&lt;BR /&gt;File(s) or dirpath(s) may be specified to reduce the output of bdfmegs:&lt;BR /&gt;&lt;BR /&gt;       bdfmegs -vg /usr/contrib/bin /var/tmp&lt;BR /&gt;&lt;BR /&gt;If bdfmegs is run as bdfgigs (ie, a link), then -g is default.&lt;BR /&gt;                                         (bdfmegs ver 5.5_Dec2009)&lt;BR /&gt;&lt;/VGNAME&gt;&lt;/FS&gt;&lt;/VGNAMES&gt;&lt;/MOUNTPOINTS&gt;&lt;/FILE&gt;</description>
    <pubDate>Thu, 06 May 2010 00:17:24 GMT</pubDate>
    <dc:creator>Bill Hassell</dc:creator>
    <dc:date>2010-05-06T00:17:24Z</dc:date>
    <item>
      <title>scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629304#M676312</link>
      <description>I am a newbie regarding scripting, and have been asked to script getting the Filesystem as well as what fs version.&lt;BR /&gt;&lt;BR /&gt;I have the following:&lt;BR /&gt;bdf |awk '{print $1}’ (which will give me each filesystem)&lt;BR /&gt;&lt;BR /&gt;but drawing a blank on how to pass this variable to the following command:&lt;BR /&gt;&lt;BR /&gt;and fstyp -v VARIABLE | grep -i version &amp;gt; new.file (which i believe would give me the version for each filesystem listed and send the info to a file)&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be appreciated!&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2010 19:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629304#M676312</guid>
      <dc:creator>Mhanby</dc:creator>
      <dc:date>2010-05-05T19:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629305#M676313</link>
      <description>something like this should come close:&lt;BR /&gt;&lt;BR /&gt;for LV in $(bdf -l |awk '{print $1}')&lt;BR /&gt;do&lt;BR /&gt;VERS=$(fstyp -v ${LV} |grep -i version)&lt;BR /&gt;echo ${LV} - ${VERS}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2010 20:13:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629305#M676313</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-05-05T20:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629306#M676314</link>
      <description>This may be closer still:&lt;BR /&gt;&lt;BR /&gt;for LV in $(bdf -l |awk '{print $1}' |grep -v Filesystem)&lt;BR /&gt;do&lt;BR /&gt;VERS=$(fstyp -v ${LV} |grep -i -e ^version -e ^hfs)&lt;BR /&gt;echo ${LV} - ${VERS}&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This gets rid the heading in the bdf output and also takes into account any HFS file systems. It looks for "hfs" at the beginning of a line and echos that since HFS filesystems do not have a "version" line.</description>
      <pubDate>Wed, 05 May 2010 20:17:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629306#M676314</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2010-05-05T20:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629307#M676315</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You might do:&lt;BR /&gt;&lt;BR /&gt;# cat queryfs&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;bdf | awk 'NR==1 {next};print $1,$NF}' | \&lt;BR /&gt;while read DEV MNT&lt;BR /&gt;do&lt;BR /&gt;    printf "%s %s " ${DEV} ${MNT}&lt;BR /&gt;    fstyp -v ${DEV} | \&lt;BR /&gt;        awk 'NR==1 {KIND=$1};&lt;BR /&gt;            /^version|^hfs/ {print %s %s\n",KIND,$0}'&lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 05 May 2010 21:03:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629307#M676315</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-05T21:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629308#M676316</link>
      <description>&lt;!--!*#--&gt;The attached script will provide all the details you need. Run it as root with -v:&lt;BR /&gt; &lt;BR /&gt;bdfmegs -v&lt;BR /&gt; &lt;BR /&gt;To see all the other options, use -h or -?:&lt;BR /&gt; &lt;BR /&gt;bdfmegs -h&lt;BR /&gt; &lt;BR /&gt;Usage:  bdfmegs [ -cghlNPpqstuVv ] [ &lt;FILE&gt; ]&lt;BR /&gt;  where:&lt;BR /&gt;    -c # = Sort on column #&lt;BR /&gt;    -d = Toggle divisor (1000 or 1024, current=1000)&lt;BR /&gt;    -g = show gigabytes, otherwise megabytes&lt;BR /&gt;    -h = Usage (return code=0, Usage to stdout)&lt;BR /&gt;    -l = local (no NFS)&lt;BR /&gt;    -M &lt;MOUNTPOINTS&gt; = skip (grep -v) mountpoints&lt;BR /&gt;    -N &lt;VGNAMES&gt; = skip one or more volume groups&lt;BR /&gt;        Repeat -N or use commas: -N vg10,vg24&lt;BR /&gt;    -p ## = highlight % -ge ##&lt;BR /&gt;    -P ## = show only % -ge ##&lt;BR /&gt;    -q = suppress header line and no char enhancements&lt;BR /&gt;    -s = summarize total, used and available&lt;BR /&gt;    -t &lt;FS&gt; = specifc filesystem: (hfs vxfs nfs cdfs cifs autofs DevFS)&lt;BR /&gt;    -u = usage (return code=0, Usage to stdout)&lt;BR /&gt;    -v = verbose (type, version, largefiles)&lt;BR /&gt;         (version info needs read permission for mountpoint)&lt;BR /&gt;    -V &lt;VGNAME&gt; = select one or more volume groups&lt;BR /&gt;       Repeat -V or use commas: -V vg00,vg01&lt;BR /&gt;&lt;BR /&gt;File(s) or dirpath(s) may be specified to reduce the output of bdfmegs:&lt;BR /&gt;&lt;BR /&gt;       bdfmegs -vg /usr/contrib/bin /var/tmp&lt;BR /&gt;&lt;BR /&gt;If bdfmegs is run as bdfgigs (ie, a link), then -g is default.&lt;BR /&gt;                                         (bdfmegs ver 5.5_Dec2009)&lt;BR /&gt;&lt;/VGNAME&gt;&lt;/FS&gt;&lt;/VGNAMES&gt;&lt;/MOUNTPOINTS&gt;&lt;/FILE&gt;</description>
      <pubDate>Thu, 06 May 2010 00:17:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629308#M676316</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-05-06T00:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629309#M676317</link>
      <description>Thanks to all.  I will try to test them out soon!  Thanks again!</description>
      <pubDate>Thu, 06 May 2010 12:13:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629309#M676317</guid>
      <dc:creator>Mhanby</dc:creator>
      <dc:date>2010-05-06T12:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629310#M676318</link>
      <description>hi again!  All your suggestions got me close, but still not quite there yet.... I still see a few lines which throws off the pattern: LV - version&lt;BR /&gt;&lt;BR /&gt;For instance, this here's a few lines illustrating some of the outliers...&lt;BR /&gt;&lt;BR /&gt;/dev/vgXX/lvolX - version: 3&lt;BR /&gt;/ddd/vgxxxxx/lvxname - version: 3&lt;BR /&gt;39452672 -&lt;BR /&gt;/dev/vgyyyyy/lvyname - version: 3&lt;BR /&gt;23412736 -&lt;BR /&gt;/dev/vgzzzzz/lvzname - version: 4&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any further suggestions what caused the issue and how I can resolve it?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 18:44:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629310#M676318</guid>
      <dc:creator>Mhanby</dc:creator>
      <dc:date>2010-05-24T18:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629311#M676319</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;I'm sorry, it appears that I dropped or otherwise mangled some of my original post.  Try:&lt;BR /&gt;&lt;BR /&gt;# cat queryfs&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;bdf | awk '{if (NF==1) {line=$0;getline;sub(" *"," ");&lt;BR /&gt;    print line$1,$NF} else {print $1,$NF}}' | \&lt;BR /&gt;        while read DEV MNT&lt;BR /&gt;        do&lt;BR /&gt;            printf "%s %s " ${DEV} ${MNT}&lt;BR /&gt;            fstyp -v ${DEV} | awk 'NR==1 {KIND=$1};&lt;BR /&gt;                /^version|^hfs/ {printf "%s %s\n",KIND,$0}'&lt;BR /&gt;    done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 19:03:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629311#M676319</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T19:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629312#M676320</link>
      <description>&lt;!--!*#--&gt;&amp;gt; hi again! All your suggestions got me close, but still not quite there yet.... I still see a few lines which throws off the pattern: LV - version&lt;BR /&gt; &lt;BR /&gt;Are the original bdf lines split? This is an annoying feature of bdf which is why I wrote bdfmegs. To get a clean, 1-liner output from bdf, do this:&lt;BR /&gt; &lt;BR /&gt;bdf -l | while read FS TOT USED AVAIL PERCENT MNT&lt;BR /&gt;   do&lt;BR /&gt;      if [ $FS != "Filesystem" ]&lt;BR /&gt;      then&lt;BR /&gt;           if [ "$TOT" = "" ]&lt;BR /&gt;           then&lt;BR /&gt;             read TOT USED AVAIL PERCENT MNT&lt;BR /&gt;           fi&lt;BR /&gt;           echo  $FS $TOT $USED $AVAIL $PERCENT $MNT&lt;BR /&gt;      fi&lt;BR /&gt;   done&lt;BR /&gt; &lt;BR /&gt;This will give you a clean list of mountpoints. But you can get exactly what you want with bdfmegs:&lt;BR /&gt; &lt;BR /&gt;bdfmegs -vq | awk '{print $NF,"-", $(NF-2)}'&lt;BR /&gt;/ - 5&lt;BR /&gt;/stand - na&lt;BR /&gt;/var - 5&lt;BR /&gt;/usr - 5&lt;BR /&gt;/tmp - 5&lt;BR /&gt;/opt - 5&lt;BR /&gt;/home - 5&lt;BR /&gt;/crashFiles - 6&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 19:21:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629312#M676320</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-05-24T19:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: scripting ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629313#M676321</link>
      <description>&lt;!--!*#--&gt;Hi (again):&lt;BR /&gt;&lt;BR /&gt;Oops, now I dropped the code that skips the header of 'bdf'.  This fixes that and handles multi-line 'bdf' output:&lt;BR /&gt;&lt;BR /&gt;# cat queryfs&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;bdf | awk 'NR==1 {next};{if (NF==1) {line=$0;getline;sub(" *"," ");&lt;BR /&gt;    print line$1,$NF} else {print $1,$NF}}' | \&lt;BR /&gt;        while read DEV MNT&lt;BR /&gt;        do&lt;BR /&gt;            printf "%s %s " ${DEV} ${MNT}&lt;BR /&gt;            fstyp -v ${DEV} | awk 'NR==1 {KIND=$1};&lt;BR /&gt;                /^version|^hfs/ {printf "%s %s\n",KIND,$0}'&lt;BR /&gt;    done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;# ./queryfs&lt;BR /&gt;/dev/vg00/lvol3 / vxfs version: 6&lt;BR /&gt;/dev/vg00/lvol1 /stand vxfs version: 5&lt;BR /&gt;/dev/vg00/lvol8 /var vxfs version: 6&lt;BR /&gt;/dev/vg00/lvol7 /usr vxfs version: 6&lt;BR /&gt;/dev/vg00/lvol6 /tmp vxfs version: 6&lt;BR /&gt;/dev/vg01/lvol1 /sysdev vxfs version: 6&lt;BR /&gt;/dev/vg01/lvol2 /patches vxfs version: 6&lt;BR /&gt;/dev/vg00/lvol5 /opt vxfs version: 6&lt;BR /&gt;/dev/vg00/lvol4 /home vxfs version: 6&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 24 May 2010 21:45:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting/m-p/4629313#M676321</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-05-24T21:45:50Z</dc:date>
    </item>
  </channel>
</rss>

