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

$RANDOM is bash specific and should be avoided [JIRA: TOOLS-475] #215

Open
larshesel opened this issue Feb 15, 2017 · 1 comment
Open

$RANDOM is bash specific and should be avoided [JIRA: TOOLS-475] #215

larshesel opened this issue Feb 15, 2017 · 1 comment

Comments

@larshesel
Copy link
Contributor

The runner shell script is using a bashism, namely $RANDOM:

https://github.com/basho/node_package/blob/develop/priv/base/runner#L309

but the runner script is using /bin/sh which on many systems is not bash and thus $RANDOM is undefined:

https://github.com/basho/node_package/blob/develop/priv/base/runner#L1

Something portable would need to be used in place of $RANDOM.

@Basho-JIRA Basho-JIRA changed the title $RANDOM is bash specific and should be avoided $RANDOM is bash specific and should be avoided [JIRA: TOOLS-475] Feb 15, 2017
@larshesel
Copy link
Contributor Author

larshesel commented Feb 15, 2017

A possible solution may be something like:

tr -cd 0-9 </dev/urandom | head -c 3

But I have no idea if one can really count on tr, head and /dev/urandom to be present on all systems (OSX, Solaris...)

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

No branches or pull requests

2 participants