Embedding other scripting languages in Bash

Mix It Up

© Lead Image © Nebari, Fotolia.com

© Lead Image © Nebari, Fotolia.com

Article from Issue 293/2025
Author(s):

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.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Tutorial – Shell Scripting

    You do not need to learn low-level programming languages to become a real Linux power user. Shell scripting is all you need.

  • Bash 5.0

    It's a coincidence that the Linux kernel and Bash jumped to version 5.0 at about the same time. While Linus assigns the numbers as he sees fit, Bash changes its version when major adjustments are made. Here's what users can expect in Bash 5.

  • Xonsh

    Create lightweight Raspberry Pi scripts with Xonsh, a Python shell that lets you write scripts in Python with Bash commands mixed in.

  • Ren'Py

    Ren'Py helps you create Android, Linux, macOS, Windows, and HTML5 games and apps.

  • Bash Stats

    With just one line of Bash you can use tools like AWK and gnuplot to quickly analyze and plot your data.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News