From 0056e6197b976947f6afa66c7a4a06580d93f07a Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sun, 27 Feb 2022 18:02:18 +0900 Subject: [PATCH] include/inst: Expect arguments from opt_get_argv() in multiple lines The inst module expects `opt_get_argv()` to print all command line arguments in one line, however the behavior of `opt_get_argv()` has been changed to print arguments line-by-line. This commit modifies the inst module so that it expects arguments to be returned one per line by `opt_get_argv()`. --- include/inst.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/inst.sh b/include/inst.sh index 398da98..551b959 100644 --- a/include/inst.sh +++ b/include/inst.sh @@ -87,7 +87,7 @@ inst_list() { local owner local semval local state - local argv + local argv local status_text local status_time local timestamp @@ -95,7 +95,7 @@ inst_list() { owner="${sem##*/}" semval=$(sem_peek "$sem") - if ! argv=$(<"$sem.argv") 2> /dev/null; then + if ! readarray -t argv < "$sem.argv" 2> /dev/null; then continue fi @@ -114,7 +114,7 @@ inst_list() { state="RUNNING" fi - echo "$owner $state [$timestamp:$status_text] $instname $argv" + echo "$owner $state [$timestamp:$status_text] $instname ${argv[*]}" done < <(find "$instpath" -regex ".*/[0-9]+") return 0 -- 2.47.3