dfree example

Harald Koenig koenig at science-computing.de
Thu Oct 23 11:56:22 GMT 2003


Hi samba,

dfreecommand.xml gives a small script example for a "dfree" command.

this sample script will fail if the output of "df" got split into 
two lines because of long first argument (e.g. when using long LVM
vaolume names or for NFS mounts...).

here is a better sample without this problem (and with less "quotes":):

--- samba-3.0.0/docs/docbook/smbdotconf/misc/dfreecommand.xml~	Thu Oct 23 13:51:39 2003
+++ samba-3.0.0/docs/docbook/smbdotconf/misc/dfreecommand.xml	Thu Oct 23 13:51:51 2003
@@ -37,7 +37,7 @@
 
 <para><programlisting format="linespecific"> 
 #!/bin/sh
-df $1 | tail -1 | awk '{print $2&quot; &quot;$4}'
+df $1 | tail -1 | awk '{print $(NF-4),$(NF-2)}'
 </programlisting></para>
 
 	<para>or perhaps (on Sys V based systems):</para>


Harald Koenig
-- 
"I hope to die                                      ___       _____
before I *have* to use Microsoft Word.",           0--,|    /OOOOOOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen.        <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig                                          \/\/\/\/\/\/\/\/\/
science+computing ag                                    //  /     \\  \
koenig at science-computing.de                            ^^^^^       ^^^^^



More information about the samba-technical mailing list