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 determine how long specified remote server or device was offline

Create a shell script to determine how long a specified remote server or device was offline. It is not designed to substitute monitoring solutions but to determine how long it will take to reboot the server or device. It is using convert seconds to human readable time code to display results.

Categories
SysOps

How to avoid the two most common caveats when using read command

These are easy mistakes to make as the bash builtin read command will terminate with the error exit code on the end-of-file condition and use Internal Field Separator to split the line into words. It is kind of tricky, but it is worth knowing how to deal with such problems.

Categories
SysOps

How to display TLS server extensions

Use openssl command-line utility to display TLS server extensions.

Categories
SysOps

How to convert seconds to human readable time

Create a shell script to convert seconds to human-readable time. I have reused part of an old shell script used to pretty-print system uptime to built it, as this code proved to be useful on several occasions.

Categories
Uncategorized

How to resolve hostname to IP address within a shell script

Create straightforward shell script to resolve hostname to IPv4/IPv6 address and reuse parts of it for other projects.