[rear-devel] [rear/rear] 444589: Use simplest way to get current PID in bash 3 (rel...

Johannes Meixner noreply at github.com
Tue Mar 26 16:34:59 CET 2019


  Branch: refs/heads/master
  Home:   https://github.com/rear/rear
  Commit: 444589696497271a1a40f9bea06b1f41ff30a120
      https://github.com/rear/rear/commit/444589696497271a1a40f9bea06b1f41ff30a120
  Author: Johannes Meixner <jsmeix at suse.de>
  Date:   2019-03-26 (Tue, 26 Mar 2019)

  Changed paths:
    M usr/share/rear/lib/_input-output-functions.sh

  Log Message:
  -----------
  Use simplest way to get current PID in bash 3 (related to issue 2089)


  Commit: f6a36de48e733cb1f4996906f4995e18baf41797
      https://github.com/rear/rear/commit/f6a36de48e733cb1f4996906f4995e18baf41797
  Author: Johannes Meixner <jsmeix at suse.com>
  Date:   2019-03-26 (Tue, 26 Mar 2019)

  Changed paths:
    M usr/share/rear/lib/_input-output-functions.sh

  Log Message:
  -----------
  Merge pull request #2099 from jsmeix/use_simplest_way_to_get_current_PID_in_bash_3_related_to_pull_request_2088

Use the simplest way to get our current PID
in bash 3.x that has no $BASHPID (as bash 4.x has)
that works in a (possibly deeply nested) subshell
(then our current PID is the one of that subshell)
and that also works when it is in a sourced script
by calling the bash builtin 'read' as follows:
read current_pid junk </proc/self/stat
(our current PID is the first field in /proc/self/stat)
see https://github.com/rear/rear/issues/2089 therein in particular
https://github.com/rear/rear/issues/2089#issuecomment-476590268


Compare: https://github.com/rear/rear/compare/e14baee63576...f6a36de48e73


More information about the rear-devel mailing list