Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Bad Substitution #40

Open
polyrtm opened this issue Jul 27, 2019 · 2 comments
Open

Bad Substitution #40

polyrtm opened this issue Jul 27, 2019 · 2 comments

Comments

@polyrtm
Copy link

polyrtm commented Jul 27, 2019

When I run the install.sh file, I get an error.

./install.sh: line 3: ${${XDG_DATA_HOME}:-${HOME}/.local/share}: bad substitution
@carnager
Copy link
Collaborator

can't reproduce:

carnager@caprica ~ > xdg=${${XDG_DATA_HOME}:-${HOME}/.local/share}
carnager@caprica ~ > echo "${xdg}"
/home/carnager/.local/share

@Kabouik
Copy link

Kabouik commented Aug 6, 2019

Same issue for me.

mathieu@xiaomimi-solus ~/.config/rofi-themes $ xdg=${${XDG_DATA_HOME}:-${HOME}/.local/share}
bash: ${${XDG_DATA_HOME}:-${HOME}/.local/share}: bad substitution

This is dirty, but just replacing the corresponding line in install.sh fixed the issue for me:

#!/usr/bin/env bash

xdg=${HOME}/.local/share
DIRECTORY="${xdg}/rofi/themes/"

if [ ! -d "${DIRECTORY}" ]
then
    echo "Creating theme directory: ${DIRECTORY}"
    mkdir -p "${DIRECTORY}"
fi

declare -i ia=0
for themefile in **/*.rasi 
do
    if [ -f "${themefile}" ] && [ ${ia} -eq 0 ]
    then
        echo "Theme '${themefile}' exists, overwrite? y/N/a(ll)"
        read answer
        if [ x$answer = x"y" ]
        then
            echo "+Installing '${themefile}'"
            install "${themefile}" "${DIRECTORY}"
        elif [ x${answer} = x"a" ]
        then
            ia=1
            echo "+Installing '${themefile}'"
            install "${themefile}" "${DIRECTORY}"
        else
            echo "+Skipping ${themefile}"
        fi 
    else
            echo "+Installing '${themefile}'"
            install "${themefile}" "${DIRECTORY}"
    fi
done

Not that there was an issue with DIRECTORY="${xdg}/rofi/themes/"}, the last } was not opened before I think. Removing it seems to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants