Scripting allows you to automate repetitive tasks, connect different software tools, and quickly solve small problems with minimal code.
This differs from traditional programming, which focuses on building structured, long-term software projects with scalability and maintainability in mind.
Scripting means the following:
Scripts, too, are “only” programs. However, they differ from large software projects in the way they are programmed, the tools/components used, and their objectives:
In large software projects, an extremely important goal is that code be developed “cleanly”—that is, the code can be understood by all members of the team and later extended or modified. In other words, all guidelines of modern software design are observed.
Scripting, on the other hand, is about solving a small problem quickly and pragmatically (getting things done). Of course, you shouldn’t go out of your way to develop sloppy scripts! Scripts should also use meaningful variable names, be documented with comments, contain basic error protection, and so on. But the priorities and development goals of a script that should be ready within a day if possible are quite different from the priorities and development goals for a software project whose code may need to be maintained for a decade.
In the context of scripting, sometimes, you’ll hear talk of “glue code.” Accordingly, scripting languages are sometimes referred to as “glue languages.” What do these terms mean?
In larger projects, the proverbial glue is often necessary to connect independent or incompatible software components. In the simplest case, a script calls some external commands that in themselves have nothing to do with each other: One creates a backup of a database, the second encrypts the resulting file, the third transfers the file to another server via HTTP, and so on. Each of the commands used was developed independently of all the others. But by connecting the commands through your script, a new meaningful component is created.
Glue code is sometimes also necessary to efficiently apply modern software development tools. For example, let’s say your team is developing a large project in JavaScript using tools like Git (version control) and Docker (containers for local testing environments). Each time a team member completes (“checks in”) a new test version, the current code should be transferred (“deployed”) to an external test server. This step could be performed by a small script.
Theoretically, you can perform such tasks with any programming language. However, scripting languages are particularly well suited for these tasks because of their simple syntaxes, minimal development overhead, and the fact that scripts create few (or even no) new project dependencies.
Unix programs were developed according to the motto “Do one thing and do it well,” formulated by Doug McIlroy, and these programs are still assessed by this standard today. When Unix became Linux and macOS, what was then called a “program” is now called a “command.” But the principle has not changed: A command like ls, grep, or find is expected to perform a very specific task and to do that task really well.
What does Unix’s motto have to do with scripting? On Linux and macOS, when you develop scripts in the Bash or Zsh languages, you do so on a foundation of several hundred commands that meet the Unix recommendation. You would be well advised to adopt the motto for your own projects as well. Write scripts that perform one task neatly.
Editor’s note: This post has been adapted from a section of the book Scripting: Automation with Bash, PowerShell, and Python by Michael Kofler. Dr. Kofler is a programmer and Linux administrator. He studied electrical engineering/telematics at Graz University of Technology. He has been one of the most successful and versatile computing authors in the German-speaking world for many years. His current topics include Linux, Docker, Git, hacking and security, Raspberry Pi, and the programming languages Swift, Java, Python, and Kotlin. Dr. Kofler also teaches at the Joanneum University of Applied Sciences in Kapfenberg, Austria.
This post was originally published in 2/2025.