Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue]: VentoyPlugson.sh 113: Bad substitution #1809

Closed
1 task done
lionslair opened this issue Aug 23, 2022 · 8 comments
Closed
1 task done

[issue]: VentoyPlugson.sh 113: Bad substitution #1809

lionslair opened this issue Aug 23, 2022 · 8 comments

Comments

@lionslair
Copy link

Official FAQ

  • I have checked the official FAQ.

Ventoy Version

1.0.79

What about latest release

Yes. I have tried the latest release, but the bug still exist.

BIOS Mode

Legacy BIOS Mode

Partition Style

MBR

Disk Capacity

32GB

Disk Manufacturer

Sandisk

Image file checksum (if applicable)

No response

Image file download link (if applicable)

No response

What happened?

Trying to use the plugin tool but I get this error contantly 113: Bad substitution

I just can not start the plugin.

I am running on popos 20.04

sudo sh VentoyPlugson.sh /dev/sda1 VentoyPlugson.sh: 113: Bad substitution

@ventoy
Copy link
Owner

ventoy commented Aug 23, 2022

What about sudo bash VentoyPlugson.sh /dev/sda1 ?

@lionslair
Copy link
Author

Head of the file and the documentation says to yse sh

$ head VentoyPlugson.sh                                                                                                                                                                                        
╰─$ head VentoyPlugson.sh                                                                                                                                                                                        2 ↵
#!/bin/sh

. ./tool/ventoy_lib.sh

print_usage() {    
    echo 'Usage:  sudo sh VentoyPlugson.sh [OPTION] /dev/sdX'
    echo '  OPTION: (optional)'
    echo '   -H x.x.x.x  http server IP address (default is 127.0.0.1)'
    echo '   -P PORT     http server PORT (default is 24681)'
    echo '   -h          print this help'

That has started it though. The help even says to run sh?

@ventoy
Copy link
Owner

ventoy commented Aug 23, 2022

/bin/sh is linked to /bin/bash in many systems. What about in your PopOS?
Did you try sudo bash VentoyPlugson.sh /dev/sda1 ?

@lionslair
Copy link
Author

/bin/sh is linked to /bin/bash in many systems. What about in your PopOS? Did you try sudo bash VentoyPlugson.sh /dev/sda1 ?

Yes that did work. I didn't run that as I thought it was going to run under sh not bash anyway

@ventoy
Copy link
Owner

ventoy commented Aug 23, 2022

Please try this new script. (download the attachment and extract the new VentoyPlugson.sh)
Just use sudo sh VentoyPlugson.sh /dev/sda1 to see whether it can work this time.

VentoyPlugson.zip

@lionslair
Copy link
Author

Please try this new script. (download the attachment and extract the new VentoyPlugson.sh) Just use sudo sh VentoyPlugson.sh /dev/sda1 to see whether it can work this time.

VentoyPlugson.zip

Yes that works now.

Ventoy version in Disk: 1.0.79
Disk Partition Style  : MBR
Secure Boot Support   : NO
/dev/sda1 is mounted at /media/nathanr/Ventoy exfat
ventoy directory exist OK

===============================================================
  Ventoy Plugson Server is running ...
  Please open your browser and visit http://127.0.0.1:24681
===============================================================

################## Press Ctrl + C to exit #####################

@CollinDewey
Copy link

CollinDewey commented Sep 9, 2022

There's no guarantee that bash is located at /bin/bash. NixOS for example, doesn't put bash in /bin/bash. Thus using /usr/bin/env bash is generally a better solution than hard-coding the path for bash.

@ventoy
Copy link
Owner

ventoy commented Sep 9, 2022

@LegitMagic
That make sense. Maybe the following is better.

if [ "$1" = "__vbash__" ]; then
    shift
else
    exec /usr/bin/env bash $0 "__vbash__" "$@"    
fi

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

No branches or pull requests

3 participants