Advanced Bash regex with examples

Advanced Bash regex with examples

Using the power of regular expressions, one can parse and transform textual based documents and strings. This article is for advanced users, who are already familiar with basic regular expressions in Bash. For an introduction to Bash regular expressions, see our Bash regular expressions for beginners with examples article instead. Another article which you may find interesting is Regular Expressions in Python.

Ready to get started? Dive in and learn to use regexps like a pro!

In this tutorial you will learn:

  • How to avoid small operating system differences from affecting your regular expressions
  • How to avoid using too-generic regular expression search patters like .*
  • How to employ, or not employ, extended regular expression syntax
  • Advanced usage examples of complex regular expressions in Bash

Read more

Git tutorial for Beginners

Git tutorial for Beginners

If you have been using GNU/Linux for any amount of time chances are pretty good that you have heard of git. You may be wondering, what exactly is git and how do I use it? Git is the brainchild of Linus Torvalds, who developed it as source code management system during his work on the Linux kernel.

Read more

Python Regular Expressions with Examples

Python Regular Expressions with Examples

A regular expression (often abbreviated to “regex”) is a technique, and a textual pattern, which defines how one wants to search or modify a given string. Regular expressions are commonly used in Bash shell scripts and in Python code, as well as in various other programming languages.

In this tutorial you will learn:

  • How to start with Regular Expressions on Python
  • How to import regex Python module
  • How to match strings and characters using Regex notation
  • How to use the most common Python Regex notations

Read more

Multi-threaded Bash scripting & process management

Multi-threaded Bash scripting & process management at the command line

The things you can do using Bash script are limitless. Once you begin to developed advanced scripts, you’ll soon find you will start to run into operating system limits. For example, does your computer have 2 CPU threads or more (many modern machines have 8-32 threads)? If so, then you will likely benefit from multi-threaded Bash scripting and coding. Continue reading and find out why!

In this tutorial you will learn:

  • How to implement multi-threaded Bash one-liners directly from the command line
  • Why multi-threaded coding almost always can and will increase the performance of your scripts
  • How background and foreground processes work and how to manipulate job queues

Read more

Introduction to Javascript loops

Introduction to Javascript loops

Nowadays Javascript can be easily defined as the world most used programming language: it is used on a variety of platforms, it is integrated in web browsers and thanks to the Node.js runtime it can also be used server-side. In this tutorial we will see the loops we can be used in modern Javascript.

In this tutorial you will learn:

  • What is the syntax and how the while loop works in Javascript
  • The syntax of the do/while loop and how it works in Javascript
  • The syntax of the for loop and how it works in Javascript
  • The syntax of the for/of loop and how it works in Javascript
  • The syntax of the for/in loop and how it works in Javascript

Read more

Bash Scripting - Bash Loops with examples

Bash Loops with examples

Ready to dive into Bash looping? With the popularity of Linux as a free operating system, and armed with the power of the Bash command line interface, one can go further still, coding advanced loops right from the command line, or within Bash scripts.

Harnessing this power, one can manipulate any document, any set of files, or implement advanced algorithms of almost any type and flavor. You are unlikely to run into any limitations if you use Bash as the basis for your scripting, and Bash loops form a powerful part of this.

That said, Bash loops sometimes can be tricky in terms of syntax and surrounding knowledge is paramount. Today we present with you a set of bash loop examples to help you upskill quickly and become Bash loop proficient! Let’s get started!

In this tutorial you will learn:

  • How Bash for, while and until based loops work, with examples
  • How Bash requires terminating of loop-starting statements before the do…done section of the loop can follow, and how this relates to if and other statements
  • How to implement basic and medium advanced bash loops
  • How subshells work and how they can be used inside bash loop scope declarations
  • How to start coding loops defensively, avoiding errors in the output
  • How to code one-liners (a common term used amongst Bash developers) on the command line versus implement the same code in a Bash script
  • How the ; syntax idiom is an important matter when it comes to coding Bash loops, both on the command line and in scripts

Read more

Git Branching Tutorial for beginners

Git Branching Tutorial for beginners

Branching allows git to track multiple lines of development. This essentially allows you to have multiple versions of your project in development at the same time. For example, many projects will choose to have a stable master branch while new features or bug fixes are implemented in a development or testing branch. Once the project organizers are satisfied that the changes made in the development branch have reached the required level of maturity, they may choose to merge those changes into the master branch.

Read more

radiolist-widget

How to use ncurses widgets in shell scripts on Linux

In this tutorial we will learn the basics of the dialog utility, in order to use ncurses widget in our shell scripts. We will see how to install dialog in the most used Linux distributions, some of the common options we can use to alter the behavior of dialog, how to use some widgets; among the others: inputbox, checklist, radiolist and yesno. Finally, we will see how to use the data obtained by the widget processing.

In this tutorial you will learn:

  • How to install the dialog utility on Linux
  • What are the most relevant dialog options
  • How to use the inputbox, checklist, radiolist, passwordbox, msbox, calendar and yesno widgets
  • How to manage data derived from the widget processing

Read more