Are you receiving a exit code 127 error when trying to execute a Bash script? In this tutorial, we’ll explain what causes this “command not found” error and show you how to fix it.
Programming & Scripting
Set and Get environmental shell variable using c++
Environment variables in the Bash shell can be accessed or set using a C++ program. This is facilitated by the getnenv()
and putenv()
functions defined in the C/C++ stdlib.h
library. Environmental variable expansion is a great feature of a Linux shell as it enables programmers and users to rely on the environment settings of each user separately. C++ getenv()
will read all exported environmental variables and putenv()
will set existing or create new variables.
How to integrate dialog boxes in shell scripts with Whiptail
The ability to create secure shell scripts is essential not only for system administrators, but also for users who wants to automate repetitive tasks. Sometimes, from our shell scripts, we need to provide the user with some kind of information, ask him/her to provide some input, choose from a set of alternatives, or just ask for his/her confirmation before performing a potentially dangerous operation. All those actions, can be performed from the command line, of course, but to make our scripts more user-friendly, we can use of Whiptail to customize and display textual widgets.
Example of simple bash script ftp client
If you need to use FTP to upload some files to a server every so often and want to save yourself some time, you can make a simple Bash script to transfer the files quickly. Rather than entering the username, password, and directory manually, we can get our Bash script to do this tedious legwork for us. In this tutorial, you will see an example script to make FTP transfers a cinch on a Linux system.
Get stock and crypto price data using shell terminal on Linux
If you want to retrieve stock quotes and crypto price data, you do not even need to leave your command line terminal. In this tutorial, we will show you how to use a Bash script to get stocks and crypto pricing on a Linux system.
How to write Nautilus extensions with nautilus-python
Nautilus, also known as “Files”, is the default file manager of the GNOME desktop environment. In a previous tutorial we saw how to create and call custom scripts from the Nautilus context-menu: this feature can be really useful but is somehow limited. By installing the nautilus-python package in our favorite Linux distribution, and writing just few lines of Python code, we can overcome such limitations and create proper Nautilus extensions.
Alias example accepting arguments and parameters on Linux
Creating an alias is a good way to make commands easier to remember and quicker to type. In case you want to extend the functionality of your aliases even further, it is possible to have them accept arguments and parameters. This gives users the ability to execute complex and lengthy commands in only a few keystrokes on the command line.
How to extend PCManFM with custom actions
PCManFM is a free and open source file manager which is meant to be a lightweight alternative to applications like Thunar (the default Xfce4 file manager) or Nautilus/Files (the GNOME counterpart). Although designed to by easy on resources, PCManFM doesn’t lack functionalities, and it can be extended with custom actions.
EEPROM CH341A programmer – Read and write data to chip on Linux
In this tutorial we will use CH341A programmer to read, write and erase data/firmware on attached chip. This is your getting started guide to CH341A programmer. CH341A programmer allows users to attach variety of chips in order to read or backup firmware or overwrite the exiting firmware.
Best text editor for Linux
There are many different text editor choices for a Linux system. Your choice of which text editor to use will depend on the type of work you plan on doing. For example, writing basic documents vs. coding websites or programs. Whatever your case, there are a lot of nice text editors available.
Rename/Replace white space in files in entire directory recursively
The purpose of this tutorial is to show various methods on how to rename or replace white space in multiple files. Some tools on a Linux system may not work properly with files that contain white spaces, which would give some users motivation to replace the white space with underscores, for example. Manipulating files without white space is much easier, as you do not have to worry about escaping the file name each time.
How to extract a number from a string using Bash example
The purpose of this tutorial is to show how to extract a number from a string using Bash – that is, either in a Bash script or from the Linux command line. It is common to use Bash as a utility to process strings or other textual data, so it is well equipped for the task of separating numbers out of a string. There are numerous ways to achieve this; see some of the examples below to get started.