Skip to content

to bash or not to bash #3497

@fkobi

Description

@fkobi

Hello,

with the recent inclusion of the distribution files in assets/linux/ I have noticed that some of the scripts were using bash when they could be using just the posix sh.

Here's the current state of the shebangs for sh:

$ rg "^#\!.*sh$"
assets/linux/unregisterBiglyBT
1:#!/usr/bin/env bash

assets/linux/updateBiglyBT
1:#!/usr/bin/env bash

assets/linux/registerBiglyBT
1:#!/usr/bin/env bash

mvnw
1:#!/bin/sh

core/src/com/biglybt/platform/unix/startupScript
1:#!/usr/bin/env bash

for {un,}registerBiglyBT it's trivial but updateBiglyBT & startupScript require more work.

One thing is clear: they are not written for bash -- they are shell scripts with occasional bash syntax which makes them not portable.
Right now we do not the portability (and speed, for people with alternative /bin/sh) of the posix shell nor the speed and the convenience of bash.

I think it should be decided if the project should:

  • go all in for bash
  • use bash only on Linux (FreeBSD does not ship it by default)
  • stick to the posix sh

I am willing to handle all this myself but I do not want my work to go to waste so please decide on the shell policy for this project.

also as a sidenote: Does it make sense to have the unix startup script written for bash?
as far as I know it's the standard only on GNU/Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions