wslutilities / wslu

A collection of utilities for Windows Subsystem for Linux
https://wslutiliti.es/wslu
GNU General Public License v3.0
3.44k stars 155 forks source link

Syntax error in wslfetch and wslsys #294

Closed gordonwatts closed 7 months ago

gordonwatts commented 11 months ago

Windows Version

Windows 11

Windows Build Number

22631

WSL Version

WSL 2

Distro Version

CENTOS7

WSL Utilities Version

v4.1.1-1

Describe the bug

Most of the utilities I've tried give the following syntax error on this distro:

[gwatts@SurfacePhoto ~]$ wslfetch
/usr/bin/wslfetch: line 245: "15" / 8 : syntax error: operand expected (error token is ""15" / 8 ")
/usr/bin/wslsys: line 245: "15" / 8 : syntax error: operand expected (error token is ""15" / 8 ")
/usr/bin/wslsys: line 245: "15" / 8 : syntax error: operand expected (error token is ""15" / 8 ")
 /$$      /$$  /$$$$$$  /$$       Windows Subsystem for Linux (WSL)
| $$  /$ | $$ /$$__  $$| $$       gwatts@SurfacePhoto
| $$ /$$$| $$| $$  \__/| $$       Build: 22631
| $$/$$ $$ $$|  $$$$$$ | $$       Branch: ni_release
| $$$$_  $$$$ \____  $$| $$       Release: CentOS Linux 7 (Core)
| $$$/ \  $$$ /$$  \ $$| $$       Kernel: Linux 5.15.90.1-microsoft-standard-WSL2
| $$/   \  $$|  $$$$$$/| $$$$$$$$ Uptime (Windows): 0d 1h 3m
|__/     \__/ \______/ |________/

It seems like it is still doing what it is supposed to be doing, however (opening a url, etc.).

Steps to Reproduce

sudo yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/wslutilities/RHEL_7/home:wslutilities.repo
sudo yum install -y wslu
wslfetch

Expected behavior

THe output of wslfetch as shown above, but without the syntax errors.

Additional context

Many thanks for the utilities!!

Code of Conduct

patrick330602 commented 11 months ago

can you show your bash version?

gordonwatts commented 11 months ago

Yep - that is it! On an old container where most of our work still continues in the experiment, and this bug shows up:

[gwatts@AMDOfficeCore ~]$ bash --version
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

And on a new one that we will move to over the next 5 years (and where it works):

[gwatts@AMDOfficeCore ~]$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

What is the limit of where it works?

patrick330602 commented 9 months ago

This should be suggested to be used with bash 5