Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2798

set: pipefail failing on WSL windows 11 ubuntu 22.04.3

$
0
0

i am currently having an issue with running a .sh file which can be found in here

https://github.com/grugslair/Rising-Revenant/blob/dev/contracts/scripts/default_auth.sh

i was originally dual booting windows and ubuntu 22.04 and i used to not get this error and the script worked fine so i know thats not an issue.

But for work reasons i have to now use WSL and now i cant seem to run it anymore i keep getting this

    alexhalo@Lappy:~/Rising-Revenant$ bash ./contracts/scripts/default_auth.sh: invalid option nameefault_auth.sh: line 2: set: pipefail

I have asked in other places and they told me to run a couple of checks to see if everything was being used correctly and these are the outputs:

which bash/usr/bin/bash

alexhalo@Lappy:~/Rising-Revenant$ bash --versionGNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)Copyright (C) 2020 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software; you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.

lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription:    Ubuntu 22.04.3 LTSRelease:        22.04Codename:       jammy

Was told to change the script to only use -eu and change pushd to cd... that didn't work

I have followed what this guys say here (How do I run .sh scripts?) to give executable permission but nothing

I have followed also this ("set -e -o pipefail" not working on bash script on Ubuntu 16) and tried to run every single line in the accepted answer and do get the same results as that person, but my script still doesn't run.

--edit: just for clarification on what I mean by running every single line i mean this

# Verifying what /bin/sh is symlinked to dash$ ls -l /bin/shlrwxrwxrwx 1 root root 4 2月  17  2016 /bin/sh -> dash# Verify that pipefail doesn't exist as option for dash$ dash    $ set -o | grep pipefail                                              $ set -o pipefaildash: 1: set: Illegal option -o pipefail$ sh$ set -o pipefailsh: 1: set: Illegal option -o pipefail# Try this same option in bash$ bash --posixbash-4.3$ set -o pipefailbash-4.3$  # no error

Also tried to disable dash as the default terminal (using sudo dpkg-reconfigure dash), so I would get bash but still get the error.

There is only this possible answer here ("set -eo pipefail" not working in Windows Subsystem for Linux (Ubuntu 16.04)) that i have not tried yet but to be honest i don't understand if the answer really is an answer or the guy is just making an example.

Any help would be appreciated :)


Viewing all articles
Browse latest Browse all 2798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>