all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludovic.courtes@inria.fr>
To: 63048@debbugs.gnu.org
Cc: Ekaitz Zarraga <ekaitz@elenq.tech>
Subject: bug#63048: [Home] Shell alias values are not properly quoted
Date: Mon, 24 Apr 2023 09:57:14 +0200	[thread overview]
Message-ID: <875y9l67c5.fsf@inria.fr> (raw)

Hi!

As Ekaitz reported on Mastodon, shell alias values are not properly
quoted, which causes problem when an alias value contains double-quotes
for instance:

--8<---------------cut here---------------start------------->8---
(define (bash-serialize-aliases field-name val)
  #~(string-append
     #$@(map
         (match-lambda
           ((key . #f)
            "")
           ((key . #t)
            #~(string-append "alias " #$key "\n"))
           ((key . value)
            #~(string-append "alias " #$key "=\"" #$value "\"\n")))
         val)))
--8<---------------cut here---------------end--------------->8---

The solution is to borrow and factorize the code of
‘environment-variable-shell-definitions’, which does it right.

Ludo’.




             reply	other threads:[~2023-04-24  7:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24  7:57 Ludovic Courtès [this message]
2023-04-24 10:10 ` bug#63048: [Home] Shell alias values are not properly quoted Ekaitz Zarraga
2023-04-24 17:41   ` Ekaitz Zarraga
2023-07-06 15:01     ` bug#63048: [PATCH] home: services: bash: Properly quote shell aliases Ludovic Courtès
2023-07-11 15:02       ` bug#63048: [Home] Shell alias values are not properly quoted Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y9l67c5.fsf@inria.fr \
    --to=ludovic.courtes@inria.fr \
    --cc=63048@debbugs.gnu.org \
    --cc=ekaitz@elenq.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.