aboutsummaryrefslogtreecommitdiff
path: root/shell_utils.sh
blob: 95e0d4e2377721ca4daff64dc91c32f3d53d7170 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright (C) 2021 Wojtek Kosior
# Redistribution terms are gathered in the `copyright' file.

# This file is meant to be sourced in sh.

ENDL="
"

errcho() {
    echo "$@" >&2
}

map_set_instr() {
    echo "$1__$2='$3'"
}

map_set() {
    eval "$(map_set_instr "$@")"
}

map_set_export() {
    eval "export $(map_set_instr "$@")"
}

map_get() {
    eval "echo \"\$$1__$2\""
}

map_del_instr() {
    echo "unset $1__$2"
}

map_del() {
    eval "$(map_del_instr "$@")"
}

sanitize() {
    echo "$1" | tr /.- _
}
Courtès 2022-07-14home: services: shells: Double-quote environment variable values....Ludovic Courtès 2022-04-19tests: Adjust 'guix home' test to 'home-files-service-type' changes....Ludovic Courtès 2022-03-19guix home: Add 'container' command....Ludovic Courtès 2022-03-18guix home: Implement the 'extension-graph' and 'shepherd-graph' actions....Ludovic Courtès 2022-03-10tests: Check 'guix home reconfigure' for a second generation....Ludovic Courtès 2022-03-10tests: Simplify use of 'local-file' in 'tests/guix-home.sh'....Ludovic Courtès 2022-03-10tests: Make sure 'guix home reconfigure' backs up files....Ludovic Courtès