yeah. The long name causes a line wrap. But the latest coreutils here doesn&#39;t change that.<br>Need to change the process to be<br><br>for mntp in /dev/mapper/vg1_foo /dev/mapper/vg2_foobar;<br>do<br>echo &quot;$mntp $(df -T $mntp | grep &quot;^ &quot; | awk &#39;{print $5}&#39;)&quot;<br>
done<br><br><div class="gmail_quote">On Tue, Apr 26, 2011 at 9:03 AM, Michael Trausch <span dir="ltr">&lt;<a href="mailto:mike@trausch.us">mike@trausch.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<p>This is because you have a long volume name. Upgrading to latest coreutils may help.</p>
<p>--<br>
Sent from my phone... a G2 running CM7 nightlies!</p>
<div class="gmail_quote"><div class="im">On Apr 26, 2011 9:02 AM, &quot;Damon Chesser&quot; &lt;<a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&gt; wrote:<br type="attribution">&gt; Typo/Stupid user mistake corrected, but it still does a thing I don’t know how to fix:<br>

&gt; <br>&gt; Output of the command with typo corrected and # removed:<br>&gt; <br>&gt; vgoradata 1.37TB lv008dat 100.00 GB /u008 Available 57%<br>&gt; vgoradata 1.37TB lv010dat 100.00 GB /u010 Available 1%<br>&gt; vgoradata 1.37TB lv012dat 100.00 GB /u012 Available 1%<br>

&gt; <br>&gt; df  -T output is:<br>&gt; <br>&gt; df -T /u008<br>&gt; Filesystem    Type   1K-blocks      Used Available Use% Mounted on<br>&gt; /dev/mapper/vgoradata-lv008dat<br>&gt;           reiserfs   104854396  59278980  45575416  57% /u008<br>

&gt; <br>&gt; The above is exactly as it appears in my term (at least in my email client)<br>&gt; <br>&gt; So why does df -T &quot;$MNTP&quot; |awk &#39;{print $5}&#39; produce “Available 57%” when the 6th field is actually the one that holds the %used?<br>

&gt; <br>&gt; df -T /u008 |awk &#39;{print $6}&#39;<br>&gt; Use%<br>&gt; <br>&gt; /u008<br>&gt; <br>&gt; And how can I clean up the output to only display %used as a number% like 57%?<br>&gt; <br>&gt; Is there a different command I can run to find this number? (I am looking for candidates for increased space).<br>

&gt; <br>&gt; <br>&gt; <br>&gt;  Sincerely,<br>&gt; <br>&gt; Damon Chesser<br></div>&gt; <a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&lt;mailto:<a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&gt;<div class="im">
<br>
&gt; <br>&gt; <br>&gt; From: <a href="mailto:ale-bounces@ale.org" target="_blank">ale-bounces@ale.org</a> [mailto:<a href="mailto:ale-bounces@ale.org" target="_blank">ale-bounces@ale.org</a>] On Behalf Of Jim Kinney<br>&gt; Sent: Tuesday, April 26, 2011 8:18 AM<br>

&gt; To: Atlanta Linux Enthusiasts<br>&gt; Subject: Re: [ale] bash assistance<br>&gt; <br>&gt; <br>&gt; $LVM in $DF not defined<br></div><div><div></div><div class="h5">&gt; On Apr 26, 2011 7:38 AM, &quot;Damon Chesser&quot; &lt;<a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&lt;mailto:<a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&gt;&gt; wrote:<br>

&gt;&gt; Believe it or not, this is above my rudimentary bash skills and I have hit a wall: So I am seeking advice or pointers.<br>&gt;&gt;<br>&gt;&gt; Scenario: recording Volume Group info on a server by server bases.<br>

&gt;&gt;<br>&gt;&gt; It did not take me long to realize that I wanted to script this. I am putting the output of my script into a spread sheet (copy and paste). The servers I am running this on are remote and I have no convenient way to get the output text to my workstation, so copy and paste works.<br>

&gt;&gt;<br>&gt;&gt; Desired output:<br>&gt;&gt;<br>&gt;&gt; VGname VGsize LVname LVsize LVmount_point %diskused<br>&gt;&gt;<br>&gt;&gt; I have all the above working up to LVmount where it all goes horribly bad. Here is my code:<br>

&gt;&gt; -----start-----<br>&gt;&gt; #!/bin/bash<br>&gt;&gt;<br>&gt;&gt; FILE=/tmp/dlc/vginfo_script.txt<br>&gt;&gt;<br>&gt;&gt; rm $FILE<br>&gt;&gt;<br>&gt;&gt; for VG in `vgdisplay | grep -e &quot;VG Name&quot; | awk &#39;{print $3}&#39;`<br>

&gt;&gt; do<br>&gt;&gt; VGsize=`vgdisplay $VG |grep -e &quot;VG Size&quot; | awk &#39;{print $3 $4}&#39;`<br>&gt;&gt; for LV in `vgdisplay -v $VG |grep &quot;LV Name&quot; | cut -d\/ -f4`<br>&gt;&gt; do<br>&gt;&gt; LVsize=`lvdisplay /dev/$VG/$LV | grep &quot;LV Size&quot; | awk &#39;{print $3 &quot; &quot; $4}&#39;`<br>

&gt;&gt; # for MNTP in `mount |grep &quot;$LVM&quot; | awk &#39;{print $3}&#39;`<br>&gt;&gt; # do<br>&gt;&gt; # DF=`df -T &quot;$MNTP&quot; |awk &#39;{print $6}&#39;`<br>&gt;&gt; # done<br>&gt;&gt; echo $VG $VGsize $LV $LVsize $MNTP $DF<br>

&gt;&gt; done<br>&gt;&gt; done &gt; $FILE<br>&gt;&gt;<br>&gt;&gt; ---end----<br>&gt;&gt;<br>&gt;&gt; The above code, as written outputs this:<br>&gt;&gt;<br>&gt;&gt; vgorabak8 375.00GB lvorabak8 374.90 GB<br>&gt;&gt; vgorabak7 375.00GB lvorabak7 374.90 GB<br>

&gt;&gt;<br>&gt;&gt; take out the # above and it does this:<br>&gt;&gt;<br>&gt;&gt; vgorabak8 375.00GB lvorabak8 374.90 GB /var/lib/ntp/proc Use% -<br>&gt;&gt; vgorabak7 375.00GB lvorabak7 374.90 GB /var/lib/ntp/proc Use% -<br>

&gt;&gt;<br>&gt;&gt; No idea why. This makes my head hurt. I have tried everything I can think of. It seems I don&#39;t think enough!<br>&gt;&gt;<br>&gt;&gt; Any help would be appreciated.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>

&gt;&gt;<br>&gt;&gt; Sincerely,<br>&gt;&gt;<br>&gt;&gt; Damon Chesser<br></div></div>&gt;&gt; <a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&lt;mailto:<a href="mailto:dchesser@acsi2000.com" target="_blank">dchesser@acsi2000.com</a>&gt;<div class="im">
<br>
&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; ________________________________<br>&gt;&gt; Disclaimer: This electronic transmission and any attachments contain confidential information belonging to the sender. This information may be legally protected. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient or receive this message in error, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on or regarding the contents of this information is strictly prohibited. Please notify the sender immediately if you have received this information in error.<br>

&gt;&gt;<br></div>&gt;&gt; <a href="http://www.acsi2000.com" target="_blank">www.acsi2000.com</a>&lt;<a href="http://www.acsi2000.com" target="_blank">http://www.acsi2000.com</a>&gt;<div class="im"><br>&gt; <br>&gt; _____________________________________________________________________________<br>

&gt; Scanned by IBM Email Security Management Services powered by MessageLabs. For more information please visit <a href="http://www-935.ibm.com/services/us/index.wss/offerfamily/iss/a1026954" target="_blank">http://www-935.ibm.com/services/us/index.wss/offerfamily/iss/a1026954</a><br>

&gt; _____________________________________________________________________________<br>&gt; <br>&gt; ________________________________<br>&gt; Disclaimer: This electronic transmission and any attachments contain confidential information belonging to the sender. This information may be legally protected. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient or receive this message in error, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on or regarding the contents of this information is strictly prohibited. Please notify the sender immediately if you have received this information in error.<br>

&gt; <br>&gt; <a href="http://www.acsi2000.com" target="_blank">www.acsi2000.com</a><br></div></div>
<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br><br>As long as the general population is passive, apathetic, diverted to 
consumerism or hatred of the vulnerable, then the powerful can do as 
they please, and those who survive will be left to contemplate the 
outcome.<br>- <i><i><i><i>2011 Noam Chomsky</i></i></i></i><br>