Ask HN: What high level language for writing a command line utility?
If you want the utility to be useable in most environments without the user having to install dependencies, your best choices are POSIX shell and Perl. This applies even if you only expect your utility to run on Linux, as embedded Linux systems often only have dash, a strict POSIX shell.[1] If it&#x27;s not a totally barebones environment, it will invariably also have Perl.[2]<p>For maximum portability, you&#x27;ll want to stick to POSIX shell scripts. If you want to make use of complex data structures, then you&#x27;ll probably want Perl. You can emulate arrays in POSIX shell fairly easily, but not associative arrays (aka dictionaries, hash tables).<p>[1] If you care about BSDs, know that Bash isn&#x27;t installed by default, and I&#x27;ve never needed to install it except on interactive shell servers where squeaky users were adamant about using Bash. Interestingly, Solaris has recently started shipping with Bash. But Perl is available natively on all these. I don&#x27;t know if Perl is installed by default on AIX, but it&#x27;s present on the AIX shell I have access to.<p>[2] IME you&#x27;ll find Perl at least as often as Bash, though it&#x27;s not universally the case. I never understood the recent obsession with Bash scripting. Its extensions are poorly designed (ksh is much more elegant) and it has a horridly complex implementation with subtle gotchas. The one bright point about Bash is that it has strong POSIX compliance. In any event, if you want to use Bash because of its language extensions, IMO you should just use Perl. But if you can deal without nice language constructs, you may as well stick to POSIX compliant code. Among other things, the POSIX shell documentation (the Standard Unix Specification spec is free from opengroup.org) is simple and concise and easily navigable, in stark contrast to Bash documentation. Read through the &quot;Shell Command Language&quot; chapter a couple of times and you&#x27;ll understand shell scripting better than the vast majority of seasoned Unix hackers.