~mil/mepo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] posix compatibility: remove use of ansi-c quoting

Details
Message ID
<20230725204647.213213-2-bernhard@ithnet.com>
DKIM signature
missing
Download raw message
Patch: +3 -1
---
Before this patch, the menu did not work for a user using e.g. dash as their /bin/sh.
 scripts/mepo_ui_helper_menu.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/mepo_ui_helper_menu.sh b/scripts/mepo_ui_helper_menu.sh
index f72236b..9f9b808 100755
--- a/scripts/mepo_ui_helper_menu.sh
+++ b/scripts/mepo_ui_helper_menu.sh
@@ -44,9 +44,11 @@ inputzenity() {
  else
    OPTS="$(cat)\nType Custom"
    OPTS="$(printf %b "$OPTS" | tr -d \" | awk NF)"
    newline="$(printf '\nx')"
    newline="${newline%x}"
    RESULT="$(
      echo "$OPTS" |
      xargs -d$'\n' zenity $(zenitydims 0.8 0.8) --title "Select an entry" --list --column=Selection --text "$PROMPT"
      xargs -d"$newline" zenity $(zenitydims 0.8 0.8) --title "Select an entry" --list --column=Selection --text "$PROMPT"
    )"
    if [ "$RESULT" = "Type Custom" ]; then
      TEXTINPUT=1 inputzenity
-- 
2.41.0
Details
Message ID
<afc32a9b-3a23-442f-bb63-3ceefc3db17c@app.fastmail.com>
In-Reply-To
<20230725204647.213213-2-bernhard@ithnet.com> (view parent)
DKIM signature
missing
Download raw message
On Tue, Jul 25, 2023, at 4:46 PM, nycex wrote:
> +    newline="$(printf '\nx')"
> +    newline="${newline%x}"
>      RESULT="$(
>        echo "$OPTS" |
> -      xargs -d$'\n' zenity $(zenitydims 0.8 0.8) --title "Select an 
> entry" --list --column=Selection --text "$PROMPT"
> +      xargs -d"$newline" zenity $(zenitydims 0.8 0.8) --title "Select 
> an entry" --list --column=Selection --text "$PROMPT"

Thanks for sending - sorry about the delay, this got lost on me. This is
one of those sharp edges of shell where I'm not really sure of the 'best'
solution. Do you know of any doc on ansi-c quoting and best practices
as described? E.g. is this method you sent commonly prescribed somewhere?

Curious - would `xargs -d"\\n"` work alternatively for you?

Miles
Reply to thread Export thread (mbox)