From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11974 invoked by alias); 11 Dec 2015 04:30:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37380 Received: (qmail 17721 invoked from network); 11 Dec 2015 04:30:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1449807896; bh=qrEV50pnSo6EkRYWTKYmEDsbwuC4yXF9DSseKtdgfkA=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=uMLTsMjvzkxi0Ne1ejtQ4rriXxHp4YY0HZ5yYCO8E7DgerDiZn28xD605Y57TcTYOuG1FYr6l+0xTpmIC9/YoAu3M9fR/K2/9dDXWpGkLgGfYrqJbDcf1rRU/+W+JHB62+NmSGKZ0dvL9kMgoT8ImH9xa8m7UZjhxzVKwVHWCcZsmcLhJq5/zpdoU5J4qAnTegkr9muAwZyxYp08suDVVr4LWz2tawhMj8FIMmL9zgJJTwFco75FVxBqcRgTn8MP2Xdqd3cIcRAjanwuf4BhUrwHwO5SaZHkIhf3PPm/ls0EqPJXkIReC+fZqxpI43e5cF9WwdxPW2sGKDJyU20Ipg== X-Yahoo-Newman-Id: 150861.56312.bm@smtp119.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-4 X-YMail-OSG: C7K0Hf4VM1lbrjpQTxQBfNS8Z87pudxKx3RHakvGjljnPnN 13cR1svGmMafb1f8B8FCuVKxEkaJPOiy5DywLcdUVy0fRwhhlqJwmvpEcS.k 6IIohajFz9QuoJNm4skQRF.KQEfjsBGVSC_8EpYT2a3emfWvhgrybIcWvMcY s8n70wDAmc2eku0ESdNAYHR2qS6vfQI8KWl1bv_ONf8xq3TJOTbzvyFItHG0 EE9Lu44J3nrEj2SWgIf2A48myn6OkRlPKn8_RVQ8zg3xpwCi13m44UbneqNx xUbCZnXjMxkTdUl77NNgRJKYSjwk6VCyiuyXqWWI_QS0D0ILpk_XtTKfVKJl 5Rhr4C6Bvv_bqky.8qoc3zP22h2Rh0HmBVkqqGLlWzqIbgckZIVymUt_Nnm3 TTeUEGlNjcU.i1d6tlxeka62MPBZ9k9MA_8GvQbZdVpgusKmpAoyfblGyQtP MYN62Cuoe0UpUVoScIC5_qSxR6gpYQeAHxi_U_zd1F58acXL5Z2ALMEdv9EJ nwl2_SlfjDYhUxdW3lZ1W7ko2K6niuPC8CsjFkiNNJqj. X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <151210005516.ZM29920@torch.brasslantern.com> From: Oliver Kiddle References: <566272DD.6010305@gmx.com> <56632A3A.6000002@gmx.com> <11850.1449365147@thecus.kiddle.eu> <151210004823.ZM29850@torch.brasslantern.com> <151210005516.ZM29920@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: [PATCH] portable mechanism to determine noatime MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18079.1449807713.1@thecus.kiddle.eu> Date: Fri, 11 Dec 2015 05:21:53 +0100 Message-ID: <18080.1449807713@thecus.kiddle.eu> Bart wrote: > On Dec 10, 12:48am, Bart Schaefer wrote: > - Why don't we grep "mount" output for "noatime" FIRST, and THEN test > whether [[ $(df .) = $(df $atimeFS) ]] Seems reasonable but after playing with the idea I've found it won't work for btrfs subvolumes: they have the same device but can be mounted with different options. I created this state: # mount |grep /dev/sda6 /dev/sda6 on /var/lib/docker type btrfs (rw,relatime,space_cache) /dev/sda6 on /mnt type btrfs (rw,noatime,space_cache) df /dev/sda6 only shows one: whichever was mounted second I think. > Oops, exactly as written that runs df with no arguments if there are no > filesystems with noatime, so tweak it a little: > > df ${$(mount || /sbin/mount | awk '/noatime/ {print $1, $3}'):-""} I needed some tweaks to make that work for me. 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. df -k -- ${$({mount || /sbin/mount} >&/dev/null | awk '/noatime/ {print $1, $3}'):-""} >&/dev/null |fgrep $(df -k .|tail -1|cut -d' ' -f1) >/dev/null Oliver