Re: Help translating a bash function to execline

From: Sertonix <sertonix_at_posteo.net>
Date: Thu, 05 Sep 2024 00:47:52 +0000

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

If I read the code in /etc/init.d/lvm correctly the exact return code of
dm_in_proc is not important. So if you just want to check if all commands
succeeded forx -o0 is all you need:

foreground {
        forx -E -p -o0 i { devices misc }
                grep -qs test /proc/$i
}
importas -u dm_in_proc ?
echo ${dm_in_proc}


If you use the value for a single if statment this is the shortest way:

if {
        forx -E -p -o0 i { devices misc }
                grep -qs test /proc/$i
}
Received on Thu Sep 05 2024 - 02:47:52 CEST

This archive was generated by hypermail 2.4.0 : Thu Sep 05 2024 - 02:48:22 CEST