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

Thank you - seems to work in ksh93 #176

Open
kajukenbo opened this issue Oct 21, 2021 · 1 comment
Open

Thank you - seems to work in ksh93 #176

kajukenbo opened this issue Oct 21, 2021 · 1 comment

Comments

@kajukenbo
Copy link

This is just a quick thank you.

I needed an old Perl 5.8.x - 5.10.x version for testing.
"perlbrew" has all sorts of bashisms and complexities in their scripts that defy straightforward porting to non-Bash hosts.

While your site says plenv is for "Bash", there is nothing complex about the scripts and I installed via ksh93 in minutes.

Please keep up the great work. I will try to get my head around plenv tomorrow and do some tests.

Much appreciated.

@kajukenbo
Copy link
Author

kajukenbo commented Oct 21, 2021

FWIW, I think the only issue with $ ~/.plenv/bin/plenv is that non-POSIX "here-strings" and other unnecessary Bash-isms (from 4.x +?) are used.

Here is an overview of the changes I made to make it a a bit more portable:

Oddly complicated?

#read READLINK < <( type -p greadlink readlink ) || {
  #echo "plenv: cannot find readlink - are you missing GNU coreutils?" >&2
  #exit 1
#}

Becomes:

READLINK=`type -p readlink`
export READLINK

This seems like the hard way here, perhaps I am missing something:

#export -n CDPATH
unset CDPATH

Use typeset (ksh) instead of local (Bash-ism):

:%s/local /typeset /gc

Really lazy hack

:%s/^shopt/# /

I also changed the shebang to ksh93 as a proof-of-concept:

#!/usr/bin/env ksh

Maybe when I have some time I will look into trying to make it POSIX-compliant.

@kajukenbo kajukenbo changed the title Thank you Thank you - seems to work in ksh93 Oct 21, 2021
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

1 participant