Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is super cool. I love things like this being done in gnuland.


What makes this gnuland?


bash, grep, awk, are all gnu tools


grep is from AT&T Unix version 6. awk is from AT&T Unix version 7. Bash is from Gnu but the script is actually plain old Bourne Shell from AT&T Unix version 7.


`shuf` is not POSIX, so that would make this BASH.


It wouldn't necessarily make it Bash. That would mean using actual Bash features. It's still non-portable sh, because it relies on an extra program being available, but it isn't relying on Bash itself - none of expansions or so on.

This is what makes it Bash:

    file="${1:-~/.mrkdb}"
Not shuf.


Actually, "${name-word}" has been part of the Bourne shell since the beginning, and the "${name:-word}" extension is specified in recent versions of the POSIX standard...


There is a free `shuf` for OpenBSD


"AWK was significantly revised and expanded in 1985–88, resulting in the GNU AWK implementation written by Paul Rubin, Jay Fenlason, and Richard Stallman, released in 1988.[8] GNU AWK may be the most widely deployed version" AWK wikipedia entry

If you are on linux, you are using GNU grep, not unix grep.

Others have addressed bash... so wrong on all counts.


None of it is specific to GNU and you can easily do it without any GNU tools on MacOS, if you've heard about that niche operating system.


Did MacOS finally get up to bash v4 or do you still have to upgrade manually?


I am doing this just fine with a base OpenBSD and this ISC licensed `shuf` counterpart:

https://github.com/ibara/shuf


I use BSD ksh, awk, and shuf compiled from

https://github.com/ibara/shuf


he's using sh not bash. Grep, sh, and awk predate gnu by a long-time. It's not like they invented these tools, merely made their own implementations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: