KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.82k stars 453 forks source link

Bad substitution line 2038: ${DESKTOP_SESSION} #711

Closed Hunteerq closed 3 years ago

Hunteerq commented 3 years ago

I'm submitting a ... (check one with "x")

[X] bug report
[ ] new distro request

Bug report

MacOS 11.2.1

/usr/local/bin/screenfetch: line 2038: ${DESKTOP_SESSION,,}: bad substitution
Screenshot 2021-03-18 at 23 43 13
KittyKatt commented 3 years ago

Thanks for reporting. I'll see if I have an environment around to test this.

KittyKatt commented 3 years ago

Can you do me a favor and figure out what version of Bash you're running?

bash --version or printf "%s" "${BASH_VERSION}" or bash -c "printf %s \"\$BASH_VERSION\""

Hunteerq commented 3 years ago

Sure,

hunteerq@MacBook-Pro-Artur ~ % bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.
hunteerq@MacBook-Pro-Artur ~ % printf "%s" "{$BASH_VERSION}"
{}%
hunteerq@MacBook-Pro-Artur ~ % bash -c "printf %s \"\$BASH_VERSION\""
3.2.57(1)-release%
hunteerq@MacBook-Pro-Artur ~ % zsh --version
zsh 5.8 (x86_64-apple-darwin20.0)
KittyKatt commented 3 years ago

The problem here is you have a BASH version below 4.0 installed. That's when ${var,,} was implemented. I can go through there and add a check for 4.0+ and if not, just use tr to get the same effect. Gimme a few and I'll try to have a fix out.

KittyKatt commented 3 years ago

@Hunteerq Can you pull from master and try the latest fix?

Hunteerq commented 3 years ago

It works, thank you :)

image
KittyKatt commented 3 years ago

Not a problem at all. Happy it was such an easy fix. Closing!