Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] portable mechanism to determine noatime



On Dec 11,  5:21am, Oliver Kiddle wrote:
}
} Bart wrote:
} > df ${$(mount || /sbin/mount | awk '/noatime/ {print $1, $3}'):-""}
} 
} I needed some tweaks to make that work for me.

Indeed, sorry about that.  I just noticed I missed the subshell around
(mount || /sbin/mount) [or braces would also work].

} I need -- after df
} because of automounter entries such as -hosts being interpreted as
} options. Braces around the two mount bits seem to be needed. And it
} doesn't work to fgrep for the full output of $(df .) - just the first
} word on the last line.

Oh, duh, have to discard the first line from df with the column labels.
But the whole point is to not search for just one word:

{ df -k -- ${$({mount || /sbin/mount} | awk '/noatime/ {print $1,$3}'):-""} |
fgrep "$(df -k . | tail -1)" } >&/dev/null

Searching for a full line rather than only for one word avoids the btrfs
issue you mentioned, among other things.

Is there a reason the single >&/dev/null isn't enough to throw away all
the spurious output?  The additional two >&/dev/null that you added to
your edit only do the expected thing if multios is set (which I guess
it would be, in context, but still).



Messages sorted by: Reverse Date, Date, Thread, Author