Feature #21976
closedAdd $SECONDS, $RANDOM, and other bashisms
Description
Some time ago there was a lot of discussion around a script named safe_sleep.sh in the GitHub Actions runner. Like many others, I immediately saw the serious problem with this script: it isn't written in Ruby!
To better support this use case, and to be able to sleep safely, Ruby should support $SECONDS as well as other bashisms like $RANDOM, $1, etc.
This would allow us to rewrite
In Ruby
For ease of evaluating this proposed feature I've have created the bashisms gem please give it a try!
Updated by AMomchilov (Alexander Momchilov) 3 months ago
ยท Edited
Did you think you could fly under the radar with that semi-colon?
That's not acceptable corner to cut.
For proper POSIX shell compatibility, it's imperative that the Ruby grammar be extended to accept : as a bare keyword, equivalent to true. You're in luck, because I've got just the thing! https://github.com/ruby/prism/pull/4056
Updated by nobu (Nobuyoshi Nakada) 3 months ago
Sorry to be late: https://github.com/nobu/bashism
Updated by jhawthorn (John Hawthorn) about 1 month ago
- Tags set to joke
- Status changed from Open to Closed