zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] portable mechanism to determine noatime
Date: Fri, 11 Dec 2015 22:49:22 -0800	[thread overview]
Message-ID: <151211224922.ZM4583@torch.brasslantern.com> (raw)
In-Reply-To: <18080.1449807713@thecus.kiddle.eu>

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).


  reply	other threads:[~2015-12-12  6:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 23:22 Baptiste Daroussin
2015-12-05  5:15 ` Eric Cook
2015-12-05 18:17   ` Eric Cook
2015-12-05 20:00     ` Matthew Martin
2015-12-06  1:25       ` Oliver Kiddle
2015-12-10  8:48         ` Bart Schaefer
2015-12-10  8:55           ` Bart Schaefer
2015-12-11  4:21             ` Oliver Kiddle
2015-12-12  6:49               ` Bart Schaefer [this message]
2015-12-13  2:13                 ` Oliver Kiddle
2015-12-13 16:22                   ` Bart Schaefer
2015-12-18  2:45                     ` Oliver Kiddle
2015-12-18  4:40                       ` Bart Schaefer
2015-12-30 17:49                   ` Oliver Kiddle
2015-12-30 22:43                     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=151211224922.ZM4583@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).