<div dir="ltr">You might want to consider using the contents of /proc/mounts instead of the output of df as your source of mounted file systems. /proc/mounts is easier to parse and it's the canonical source for mount information. Sometimes df will lie to you. Google "df does not show all mounts" for relevant circumstances.<div>
<br></div><div>For example, your awk and grep could be replaced with just "grep ^/dev /proc/mounts" and require no more trimming or manipulation.<div><br></div><div>QH</div></div></div><div class="gmail_extra">
<br>
<br><div class="gmail_quote">On Wed, Jun 4, 2014 at 5:17 PM, <span dir="ltr"><<a href="mailto:foo7775@comcast.net" target="_blank">foo7775@comcast.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-family:Arial;font-size:12pt;color:#000000"><div>Much appreciated Vishal, that makes complete sense. I spent enough time testing it with different combinations of backticks, etc. that I'm not at all surprised that something like that slipped through. I'll tweak it a bit <em>(either later tonight, or early tomorrow)</em> & try it again.<br>
</div><div><br></div><div>Thanks again.<br></div><div><br></div><div>T.<br></div><div><br></div><hr><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt">
<div class=""><b>From: </b>"Vishal Verma" <<a href="mailto:stellarhopper@gmail.com" target="_blank">stellarhopper@gmail.com</a>><br><b>To: </b>"list, CLUE" <<a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a>><br>
</div><b>Sent: </b>Wednesday, June 4, 2014 5:04:22 PM<div class=""><br><b>Subject: </b>Re: [clue] Bash baffler<br><div><br></div></div><div><div class="h5">But the real problem is you're using both $() and ``<br>It is trying to execute the text output of `df -hl | awk '{print<br>
$NF}' | grep -v ^\/dev` and feeding it into another subshell as a<br>command, which of course it isn't.<br><div><br></div>-Vishal<br><div><br></div>On Wed, Jun 4, 2014 at 4:59 PM, Vishal Verma <<a href="mailto:stellarhopper@gmail.com" target="_blank">stellarhopper@gmail.com</a>> wrote:<br>
> On Wed, Jun 4, 2014 at 4:53 PM, <<a href="mailto:foo7775@comcast.net" target="_blank">foo7775@comcast.net</a>> wrote:<br>>> df -hl | awk '{print $NF}' | grep -v ^\/dev<br>><br>> The 'on' seems to be coming from the last column of the 'header' of<br>
> the df command:<br>> Filesystem Size Used Avail Use% Mounted on<br>><br>> You want something like:<br>> df -hl | grep -v "^Filesystem" | awk '{print $NF}' | grep -v ^\/dev<br>><br>
> -Vishal<br>_______________________________________________<br>clue mailing list: <a href="mailto:clue@cluedenver.org" target="_blank">clue@cluedenver.org</a><br>For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" target="_blank">http://cluedenver.org/mailman/listinfo/clue</a><br></div></div></div><div><br></div></div></div><br>_______________________________________________<br>
clue mailing list: <a href="mailto:clue@cluedenver.org">clue@cluedenver.org</a><br>
For information, account preferences, or to unsubscribe see:<br>
<a href="http://cluedenver.org/mailman/listinfo/clue" target="_blank">http://cluedenver.org/mailman/listinfo/clue</a><br></blockquote></div><br></div>