On Wed, Dec 13, 2023 at 10:48:59PM -0500, Zachary Santer wrote:
> On Wed, Dec 13, 2023 at 9:17 PM Greg Wooledge <g...@wooledge.org> wrote:
> > If you'd like to read the contents of a file into a variable, the
> > "read" and "readarray" (aka "mapfile") builtins are usually better
> > choices anyway.  $(< file) would only be useful if you want the entire
> > content in a single string variable, which is a questionable idea in
> > most programs.
> sudo kill -s SIGHUP "$(< /var/run/sshd.pid)"
> The one thing I've done with this that wasn't a bad idea.

Is that on a system that lacks a process manager?  Something like
"systemctl reload ssh" or "service ssh reload" would be preferred from
a system admin POV, on systems that have process managers.

And before bash 5.2,

    read -r pid < /var/run/sshd.pid && sudo kill -s SIGHUP "$pid"

would be more efficient, on systems where no process manager is in use.

Reply via email to