Help translating a bash function to execline

From: Angelo Verlain <geoangercola_at_gmail.com>
Date: Thu, 5 Sep 2024 02:16:05 +0200

Hello everyone!

I'm quite new to execline (and mailing lists) an would like help porting
this function to execline. It's /etc/init.d/lvm from openrc.

dm_in_proc() {
    local rc=0 i=
    for i in devices misc; do
        grep -qs 'device-mapper' /proc/$i
        rc=$(($rc + $?))
    done
    return $rc
}

My current attempt looks like this, but I believe it may not be the correct
way.

  backtick -E dm_in_proc {
    foreground {
      forx -x0 -E -p i { devices misc }
      if -x1 {
        execl-cmdline -s { grep -qs "device-mapper" /proc/$i }
      }
    }
    importas -u ? ?
    echo $?
  }
Received on Thu Sep 05 2024 - 02:16:05 CEST

This archive was generated by hypermail 2.4.0 : Thu Sep 05 2024 - 02:16:50 CEST