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

bashisms in shell scripts #2922

Open
the-me1988 opened this issue Nov 2, 2021 · 9 comments
Open

bashisms in shell scripts #2922

the-me1988 opened this issue Nov 2, 2021 · 9 comments
Assignees
Milestone

Comments

@the-me1988
Copy link

Hello,

with 10.0 there are some new bashishms in some shell scripts:

bash-term-in-posix-shell [sbin/mount.glusterfs:366] '[ "$syntax_status" =='
bash-term-in-posix-shell [sbin/mount.glusterfs:90] '[ "$servers" =='
bash-term-in-posix-shell [usr/lib/x86_64-linux-gnu/glusterfs/gfind_missing_files/gfid_to_path.sh:24] '${gfid:0:2}'
bash-term-in-posix-shell [usr/lib/x86_64-linux-gnu/glusterfs/gfind_missing_files/gfind_missing_files.sh:32] '/dev/tcp'

Debians advices for it are:

N: This script is marked as running under /bin/sh, but it seems to use a feature found in bash but not in the SUSv3 or POSIX shell specification.
N: Some examples are:
N: - == in a test, it should use = instead - read without a variable in the argument - function to define a function - source instead of . - . command args, passing arguments to commands
N: via source is not supported - {foo,bar} instead of foo bar - [[ test ]] instead of [ test ] (requires a Korn shell) - type instead of which or command -v

@stale
Copy link

stale bot commented Jun 4, 2022

Thank you for your contributions.
Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity.
It will be closed in 2 weeks if no one responds with a comment here.

@stale stale bot added the wontfix Managed by stale[bot] label Jun 4, 2022
@the-me1988
Copy link
Author

This issue still exists in 10.2:

bash-term-in-posix-shell '${gfid:0:2}' [usr/lib/x86_64-linux-gnu/glusterfs/gfind_missing_files/gfid_to_path.sh:24]
bash-term-in-posix-shell '/dev/tcp' [usr/lib/x86_64-linux-gnu/glusterfs/gfind_missing_files/gfind_missing_files.sh:32]

@stale stale bot removed the wontfix Managed by stale[bot] label Jun 15, 2022
@sac
Copy link
Member

sac commented Jun 16, 2022

A related issue #3598

@stale
Copy link

stale bot commented Jan 17, 2023

Thank you for your contributions.
Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity.
It will be closed in 2 weeks if no one responds with a comment here.

@stale stale bot added the wontfix Managed by stale[bot] label Jan 17, 2023
@the-me1988
Copy link
Author

ping

@stale stale bot removed the wontfix Managed by stale[bot] label Jan 17, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

Thank you for your contributions.
Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity.
It will be closed in 2 weeks if no one responds with a comment here.

@pranithk pranithk self-assigned this Jan 3, 2025
@pranithk
Copy link
Member

@the-me1988 Is it okay to move the shell as bash shell? Will it lead to any problems?

@pranithk
Copy link
Member

I submitted a PR #4449 which includes the scripts in this as well.

@the-me1988
Copy link
Author

@the-me1988 Is it okay to move the shell as bash shell? Will it lead to any problems?

Thats ok, it just means that glusterfs then "depends" also on bash.

@pranithk pranithk added this to the Gluster 11.2 milestone Feb 7, 2025
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