Categories
SysOps

How to inspect a pipeline

A pipeline is a sequence of multiple commands separated by the control operators. It is easy to understand as long as you see the whole picture, but I will show you how to inspect it when you have a single process ID.

Categories
SysOps

How to distinguish standard error from regular output

Use bash redirection and process substitution to programmatically distinguish standard error from regular output.

Categories
SysOps

How to send output to multiple commands

Send output to multiple commands using tee utility and bash process substitution.

Categories
SysOps

How to specify the same option multiple times using Bash

Write a simple Bash shell script that will allow you to specify the same option multiple times or provide multiple arguments to a single option.

Categories
SysOps

How to remotely execute shell function

Sometimes it is very convenient to define shell function and execute it remotely.

Categories
Uncategorized

How to restart process depending on the log file modification time

Sometimes it is important to monitor log file modification time to restart the writing process when the file was not modified for defined period of time. I have already described how to check file metadata using stat utility which can be used to solve this task, but today I want to take advantage of the […]

Categories
SysOps

How to inspect command before execution

It is nothing fancy, but there are situations where it is beneficial to know how to identify and inspect command before execution.

Categories
SysOps

How to automatically logout user from the login shell after period of inactivity

I want to automatically log out the user from the login shell after a defined period of inactivity but leave X Window Terminals untouched. This will allow me to enhance security slightly, as I will not accidentally leave the superuser session running for a long time.