June 23rd, 2024

What scripting languages come out of the box on Debian 12?

The article discusses pre-installed scripting languages in Debian 12: bash, Python 3, awk, sed, and Perl. Emphasizes convenience for offline work, ease of script transfer, and benefits of learning Python.

Read original articleLink Icon
What scripting languages come out of the box on Debian 12?

The article discusses the scripting languages that come pre-installed on Debian 12. The author mentions bash, Python 3, awk, sed, and Perl as languages available out of the box. The author highlights the convenience of having these languages pre-installed, especially for offline work or on non-internet-connected systems. They emphasize the ease of transferring scripts using these languages as long as they rely on standard libraries. The article also touches on the importance of considering default language installations for future reference and the benefits of learning Python as a first programming language. Overall, the author suggests that having these scripting languages readily available in Debian 12 can simplify tasks and enhance productivity, particularly in certain working environments.

Link Icon 16 comments
By @m1keil - 4 months
> I don’t know why I don’t hear this point get more airtime among people when discussing the pros and cons of Python/Perl as scripting languages.

But it is.

Perl and awk one liners are very common. Bash is used everywhere you have the (controversial) `sudo curl .. | bash -` install method.

Ansible, if I'm not mistaken, requires python3 installed on remote hosts.

If your environments are homogeneous enough, and you don't have a large matrix of operating systems, you should definitely use this advantage.

The troubles start when you have very heterogeneous environment, custom or hardened Linux distros and etc.

It might seem like this is not being utilised as much nowadays, but I suspect it's because the "classical" Linux sysadmin roles are rare and you don't hear about it as much.

By @supriyo-biswas - 4 months
> Knowing that a language is installed by default on the most popular Linux distribution can simplify certain concerns considerably

The author laments the decline of such knowledge, but the proliferation of containers, combined with the marketing efforts of the large cloud providers has reduced the number of people who work with servers directly.

I should say that this knowledge can be useful in certain niche situations, though. For example, I recently learned that GitHub Actions pulls in a basic set of utilities by using complicated distro detection[1], and Gitlab runners similarly pulls in a Docker image with git just to clone a repository!

Instead, the proper way to address this situation would be to compile static binaries, that, by their very nature, become distribution agnostic. The only reason I assume this wasn't pursued, I assume, would be that the developers working on this weren't even aware this was an option.

It's the reason I've been maintaining a small set of packages[2] that I mount into every CI container for my personal projects. I'm also quite hopeful about the cosmopolitan project[3] that builds fat binaries which can bridge this gap, although as I discovered, some containers even lack tools like gzip (which cosmopolitan depends on), so maybe static binaries it is.

[1] https://www.youtube.com/watch?v=9qljpi5jiMQ

[2] https://github.com/supriyo-biswas/static-builds

[3] https://github.com/jart/cosmopolitan/

By @alganet - 4 months
More interestingly, it would be nice to see their reverse dependencies:

    $ apt-cache rdepends --installed sed
    sed
    Reverse Depends:
      xml-core
      fuse3
Anyway, sh, awk and sed are there because it is mandatory: https://en.wikipedia.org/wiki/List_of_POSIX_commands

Perl and Python seems to support a lot of OS userland.

If you have GNOME, you probably have the gjs command too. It's a JavaScript interpreter.

By @hnlmorg - 4 months
Would ‘bc’ also count? You can do scripting in it albeit more for mathematical functions.

I can’t recall if it’s part of Debian base though.

By @pjmlp - 4 months
This is the reason why I mastered enough vi to be dangerous, back in the day, Emacs / XEmacs were usually an additional package, while any sort of commercial UNIX had vi on its default install.

Being sent down into the field, rescuing whatever random server used by a customer, meant being able to use whatever was there, and between ed and vi, better vi.

By @contrarian1234 - 4 months
When did Python join the list?

I remember I used to use Debian instead of Ubuntu b/c a minimal install didn't include Python

By @enriquto - 4 months
> 5. sed, if you count that (I do)

If they count sed, they should definitely count vimscript !

By @gorgoiler - 4 months
Curiously, I get why Go doesnt include the source code in its binaries — presumably a hangover from the long standing tradition of source for me but not for thee, as well as sever constraints on resources meaning source-included would be a frivolity — but are there compiled languages where it is an option to include the source?

The only one I can think of is TypeScript where it builds source maps to help debug the underlying JavaScript without having to see it.

By @z3t4 - 4 months
What about compilers? What is an OS without a compiler?
By @globular-toast - 4 months
Unfortunately the Python 3 debacle kind of ruined standalone Python scripts. At least for a while. Have distros gone back to having "/usr/bin/python" available (as opposed to "python3" or something else)? I bet there's still loads of system in the wild without a "/usr/bin/python", though.
By @hiAndrewQuinn - 4 months
(This page will briefly be down, as I add my new X profile at https://x.com/hiAndrewQuinn to its frontpage. Give it maybe 2-3 minutes from the time of this comment. God bless Hugo for being so fast to recompile. EDIT: Nevermind it was more like 30 seconds!)
By @counterpartyrsk - 4 months
Perl 5? What version? Perl has been on that major version for some 20+ years, right?!
By @toolslive - 4 months
m4?
By @regularfry - 4 months
A reminder that interpreters installed with the OS are for the OS, not for you.

Plan on installing your own so that you can control versions, libraries, and packages.

(Yes, this post is about "in extremis" dev where you may not be able to do this. Still.)

By @nbabitskiy - 4 months
Я 333