News for hackers. Stuff that matters.
Re:Why does OpenBSD still include Perl in its base installat... by mfontani on Saturday May 30, 2020 @08:51AM (#23360807)
/usr/bin/perl scripts written more than twenty years ago continue to work.

So do /bin/sh and /bin/bash scripts.

/usr/bin/python scripts IME depend on what /usr/bin/python points to; some break/broke due to the python 2 to python 3 switching, which hasn't been as backwards-compatible as previous examples have.

Re:Why does OpenBSD still include Perl in its base installat... by dorfsmay on Saturday May 30, 2020 @10:21AM (#23361371)
But! If you write modern bash, it won't run everywhere, definitely won't run on mac!
Re:Why does OpenBSD still include Perl in its base installat... by xyproto on Saturday May 30, 2020 @10:35AM (#23361468)
Bash may be installed in /usr/bin (Arch Linux + symlink in /bin), /usr/local/bin (OpenBSD) or not at all, though.

"#!/usr/bin/env bash" or "#!/usr/bin/env python" are the recommended ways to run both, AFAIK.

Re:Why does OpenBSD still include Perl in its base installat... by asveikau on Saturday May 30, 2020 @11:41AM (#23361891)
I have some FreeBSD and OpenBSD machines. /usr/bin/env python doesn't work on either of them because the ports call it python3.7, python2.7, python2, etc. and there is no symlink simply called 'python'.

Sometimes I used to create such a symlink myself but I don't use or run a lot of python day to day so my current systems do not have this.

Re:Why does OpenBSD still include Perl in its base installat... by mekster on Saturday May 30, 2020 @11:23AM (#23361773)
Where is bash not installed?
Re:Why does OpenBSD still include Perl in its base installat... by asveikau on Saturday May 30, 2020 @11:43AM (#23361908)
Bash is not installed by default on any *BSD I have used (FreeBSD, OpenBSD, NetBSD, etc.). You need to install it from the ports tree or package repo.

Most (all?) commercial Unix I have used also don't have bash, but those systems are pretty dead these days.

OpenBSD's fork of ksh is actually really good so I typically feel no reason to ever install bash on there. On others, the default shell kinda sucks and I tend to install bash. In particular the old /bin/sh on older Unix tends to be worse at interactive use and not support some constructs like {a,b}

Re:Why does OpenBSD still include Perl in its base installat... by freemint on Saturday May 30, 2020 @02:43PM (#23363520)
Except Ubuntu where they ship dash by default which is not really bash compatible.
Re:Why does OpenBSD still include Perl in its base installat... by asveikau on Saturday May 30, 2020 @03:55PM (#23364085)
I think you might misunderstand me with what "bash is not installed by default" means. On the systems I'm mentioning bash is not on disk anywhere in the base install and you have to install it extra. I don't think that is the case in Ubuntu.

I'm typing this on FreeBSD. It's in /usr/local because it came from ports.

    $ which bash
    /usr/local/bin/bash
Now I try my OpenBSD machine. It's not installed at all.

    $ which bash
    which: bash: Command not found.
Re:Why does OpenBSD still include Perl in its base installat... by throw0101a on Sunday May 31, 2020 @06:08PM (#23373239)
> Except Ubuntu where they ship dash by default which is not really bash compatible.

Why would you expect it to be?

dash is a POSIX shell:

* https://en.wikipedia.org/wiki/Almquist_shell#dash

Even when called as /bin/sh, which implies Bourne/POSIX behaviour, bash leaks all kinds of functionality into the environment such that if you tru to run your "/bin/sh" script on another shell it may not work.

We had all sorts of issues when Debian made the switch: we had to tell people either (a) fix the code, or (b) change your shebang to bash.

If you want Bash behaviour call bash. It's like when I type in "vi" in the command line and I get an editor with all sorts of colours: WTF? If I wanted Vim I would have typed in "vim", but for editing a small file all I need is POSIX vi without the dog and pony display show. /rant