Denemek ALTIN - Özgür
Mix It Up
Linux Magazine
|#293/April 2025: Trojan Horse
Solve Bash blind spots by embedding other scripting languages into your Bash scripts to get the features you need. Pete shows you solutions for floating-point math, charting, GUIs, and hardware integration.

While Bash has a huge variety of command-line tools that you can integrate into your code, sometimes you can still get stuck. Bash is extremely powerful, but, like all programming languages, it has its weakness. Some typical areas that can be challenging when using Bash include:
- Floating-point math
- Charting
- Graphical user interfaces (GUIS)
- Hardware integration
Command-line utilities can help address many of these topics, such as bc for floating-point math or Zenity [1] for user dialogs. While these tools are extremely useful, they may not give you the functionality or customization that you need. A common approach to solving this issue is to write standalone programs in another language, like Python, and then have your Bash script call that program.
You can also solve Bash limitations by embedding code from another scripting language (e.g., Lua, NodeJS, PHP, Python, or Tcl/Tk) within your Bash script. This method offers the advantage of keeping all the code in one script. In this article, I'll look at solving the issues of floating-point math, charting, GUIs, and hardware integration by embedding other scripting languages into Bash.
How to Embed Other Languages
There are several techniques for embedding other programming languages in Bash. For very small code bits, a string of text can be piped to the other scripting language’s interpreter as follows:

Bu hikaye Linux Magazine dergisinin #293/April 2025: Trojan Horse baskısından alınmıştır.
Binlerce özenle seçilmiş premium hikayeye ve 9.000'den fazla dergi ve gazeteye erişmek için Magzter GOLD'a abone olun.
Zaten abone misiniz? Oturum aç
Linux Magazine'den DAHA FAZLA HİKAYE
Linux Magazine
Exercise Place
The GRUB 2 boot manager might seem intimidating at first glance. All the more reason to spin up a virtual playground so you can practice.
10 mins
#298/September 2025: Indie Game Studio
Linux Magazine
Terminal Mosaic
What's better than one command line? Many command lines that never die. Take the terminal to new places with Zellij.
9 mins
#298/September 2025: Indie Game Studio

Linux Magazine
MakerSpace
Build a Long-Range Sensor Network with ChirpStack Sensor Symphony
14 mins
#298/September 2025: Indie Game Studio

Linux Magazine
How Flatpak, AppImage, and Snap are changing software distribution Ship It!
Modern-day package systems solve some problems posed by classic formats like DEB and RPM. We look at Flatpak, AppImage, and Snap and describe how they differ.
12 mins
#298/September 2025: Indie Game Studio

Linux Magazine
Dashboard Delight
Simplify the chaos of self-hosted services with Homepage, a customizable dashboard with widgets that put service statistics at your fingertips.
9 mins
#298/September 2025: Indie Game Studio

Linux Magazine
MADDOG'S DOGHOUSE
Free software, and the FOSS community, can help technology students get the education they desire in Brazil and elsewhere.
3 mins
#298/September 2025: Indie Game Studio

Linux Magazine
Rethinking the Terminal
The Warp AI agent takes the guesswork out of working at the command line. We show you how to build a simple website with one prompt.
4 mins
#298/September 2025: Indie Game Studio
Linux Magazine
Just in Time
Just is a command runner that lets you define project-specific tasks in a declarative justfile.
7 mins
#298/September 2025: Indie Game Studio

Linux Magazine
The Watcher
This versatile security app checks for vulnerabilities, watches logs, and acts as a single interface for other tools.
7 mins
#298/September 2025: Indie Game Studio

Linux Magazine
NO INTERNETREQUIRED
This new utility lets you update a system that is notconnected to the Internet.
4 mins
#298/September 2025: Indie Game Studio
Listen
Translate
Change font size