Disparate Development
Bash and PowerShell are related, but as in all large families, the branches of the tree often take on different forms.]
|
ariwasabi, 123RF
Bash and PowerShell are related, but as in all large families, the branches of the tree often take on different forms.]
Several years have passed since my previous article looking at the command-line languages under Windows and Linux [1] – time to reinvestigate how these two opponents have developed over the past half decade. A comparison of Windows PowerShell and Bash might indicate who has the current edge in modern scripting.
Windows PowerShell was a completely fresh start of Microsoft's command language under Vista (see the "New Beginning" box). Meanwhile, Bash under Linux was always at the core of the system (see the "Tried and Tested" box) with the project participants continuously updating the interface. So, has Bash matured and got better with age, or has inherited too much cruft that weighs it down?
One of the most important characteristics of a scripting language is the ability to link two commands, assuming that one command receives, understands, and processes the output of the other. As a rule, Bash uses plain text as input and output. Thus, the following command shows the size and name of the three largest files in the /var/log directory:
[...]
Pages: 4
The Linux terminal, the shell, or whatever name you know it by, is ubiquitous in the Linux world. Although it was created in the 1970s, the earliest days of modern computing, it has not outlived its usefulness.
A simple script is usually enough to automate a knotty task in Linux, but with some simple shell commands and a little effort, you can convert a simple batch file into a robust shell program.
Many Linux beginners stumble over the fact that you need to precede any calls to your own scripts or programs with a ./ combination. What's up with these dot-slashes?
Does the ingenious script your wrote last month look like confusing spaghetti code today? We show some proven style guidelines that can provide order and readability.
The Shell Script Compiler converts scripts into binaries, which protects against accidental changes but also carries some pitfalls.
© 2025 Linux New Media USA, LLC – Legal Notice