Closed arklee closed 4 years ago
after an update,when I run screenfetch,it reports "awk: cmd. line:7: warning: regexp escape sequence `\"' is not a known regexp operator".I think it's a problem of awk,so when I switch from gawk to nawk, it disappeared.But for some reasons I still need to use gawk,I wonder if there is any solution.
I don't have such an issue:
$ awk --version
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 4.0.1, GNU MP 6.1.2)
I don't know why it says line 7 because that's just a comment line. You can try to find out where exactly inside the script awk is creating this warning by running bash -x ./screenfetch-dev >log.txt 2>&1
and taking a look at the log file.
It's a problem of gawk,I downgrade gawk from 5.0.1 to 4.2.1 then this report of "awk : cmd..." disappeared.
The issue in the script seems to be located here: screenfetch-dev:1924.
In particular,
gsub(/\"/,"",de)
gawk 5.0.1
does not recognize the expression \"
as regex operator.
Hopefully fixed now.
not yet in arch linux
not yet in arch linux
In Arch you can use screenfetch-git
package.
In Arch you can use
screenfetch-git
package.
Doesn't help.
In Arch you can use
screenfetch-git
package.Doesn't help.
I installed screenfetch-git
to solve the problem.
yay -S screenfetch-git
The new version does not show CPU temperature
@SingularBunny A little more than "Doesn't help." would help us. Is the gawk error fixed, but another error is present?
@GreenHatHG That's interesting, no idea why that's happening. Might have to open a new issue about that.
I think the real problem is on line 1603:
gpu=$(system_profiler SPDisplaysDataType | awk -F': ' '/^\ *Chipset Model:/ {print $2}' | awk '{ printf "%s / ", $0 }' | sed -e 's/\/ $//g')
I removed the backslash \
before *Chipset Model
and the warning disappeared on my machine.
I can submit a pull request if that's useful.
@SingularBunny or @arklee, can one of you try the new version on your system and confirm that the problem is resolved?
My change worked for me and seems likely (to me) to fix the problem generally, but I'm not able to check other platforms or versions of Bash or {Gawk,Awk}.
All you have to do is this:
$ cd /tmp
$ git clone https://github.com/KittyKatt/screenFetch
$ cd screenFetch
$ ./screenfetch-dev
@cfraizer Just tried the above recipe, can confirm the above awk
bug is fixed 💯
Thank you very much 🏆
I had to remove a different slash. In the DE Detection block at line 980, the first IF statement, the gsub function. Deleting the backslash fixed the problem for me. log.txt of pre-fix and current, working script on my machine attached.
Same issue. Fedora 31
This issue does not occur on openSUSE Tumbleweed with gawk 5.0.1 and screenfetch 3.9.1.
Same issue. Fedora 31
Confirmed is still in Fedora 31 gawk and screenfetch versions are:
$ sudo dnf info gawk
Last metadata expiration check: 0:00:24 ago on Mon 02 Dec 2019 09:18:52 AM -03.
Installed Packages
Name : gawk
Version : 5.0.1
Release : 5.fc31
Architecture : x86_64
Size : 2.9 M
Source : gawk-5.0.1-5.fc31.src.rpm
Repository : @System
From repo : anaconda
Summary : The GNU version of the AWK text processing utility
URL : https://www.gnu.org/software/gawk/
License : GPLv3+ and GPLv2+ and LGPLv2+ and BSD
Description : The gawk package contains the GNU version of AWK text processing utility. AWK is
: a programming language designed for text processing and typically used as a data
: extraction and reporting tool.
:
: The gawk utility can be used to do quick and easy text pattern matching,
: extracting or reformatting. It is considered to be a standard Linux tool for
: text processing.
$ sudo dnf info screenfetch
Last metadata expiration check: 0:00:51 ago on Mon 02 Dec 2019 09:18:52 AM -03.
Installed Packages
Name : screenfetch
Version : 3.8.0
Release : 6.fc31
Architecture : noarch
Size : 271 k
Source : screenfetch-3.8.0-6.fc31.src.rpm
Repository : @System
From repo : fedora
Summary : A "Bash Screenshot Information Tool"
URL : https://github.com/KittyKatt/screenFetch
License : GPLv3+
Description : This handy Bash script can be used to generate one of
: those nifty terminal theme information + ASCII distribution
: logos you see in everyone's screen-shots nowadays. It will
: auto-detect your distribution and display an ASCII version
: of that distribution's logo and some valuable information
: to the right. There are options to specify no ASCII art,
: colors, taking a screen-shot upon displaying info, and even
: customizing the screen-shot command! This script is very easy
: to add to and can easily be extended.
I confirmed it still is in Fedora 31
Are you using git or a package? Package is maintained upstream.
I'm using it from repository. It looks like it is on the fedora main repository.
Well, I fix it by deleting the extra character in line 1591 on the script that is packaged in Fedora. I saw the line in the screenfetch-dev file and I just edited the script. I think this could be better managed, but it's a solution:
Change:
gsub(/\"/,"",de)
By:
gsub(/"/,"",de)
I thing this could be closed as it is fixed in 3.9.1. Also, for Fedora I sent a PR to get the latest version
Still occurs. Fedora 32
Still occurs. Fedora 32
It's because they are shipping and outdated version. The newest version fix the problem
I've filed a bugzilla for this in the Fedora tracker
@X3MBoy I think it is still broken:
gawk: cmd. line:22: warning: regexp escape sequence `\#' is not a known regexp operator
I'm submitting a ... (check one with "x")
Bug report