unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63048: [Home] Shell alias values are not properly quoted
@ 2023-04-24  7:57 Ludovic Courtès
  2023-04-24 10:10 ` Ekaitz Zarraga
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2023-04-24  7:57 UTC (permalink / raw)
  To: 63048; +Cc: Ekaitz Zarraga

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’.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-11 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-24  7:57 bug#63048: [Home] Shell alias values are not properly quoted Ludovic Courtès
2023-04-24 10:10 ` 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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).