Posts Tagged “bash”:

MySQL/MariaDB database daily backup

Yuram has shown some keen interest in Bash scripting recently. He even took the Bash Cookbook from me to enrich his knowledge. To keep the spirit I often ping him with small challenges. While having a coffee at work today we discussed about a script to backup my databases on... [Read More]

Bash – for loop

Say you have some PHP files and you need to replace the .php extension with .html. The “for” loop in bash comes handy to do this task. However, prior to renaming we need to strip the .php extension from the file name and here awk does a great job. See... [Read More]

Bash script for remote command execution

I’ve come across this a couple of times. As a system admin’s day to day tasks, your boss must have at some time given you a long list (let’s say 50+) of servers and all you got to do is getting some system information. Yeah, I know the feeling. It... [Read More]

While True

On Solaris servers I’ve missed the ‘watch’ command. Mostly when you have filesystems filling up fast. The ‘watch’ command nowadays comes bundled with most distros but not on those proprietary systems. I had to find a way of getting it done on Solaris, AIX or any other *nix family. Here’s... [Read More]
Tags: bash unix solaris

Bash - the while loop

The Bash while loop. Print ‘this is a test’ 10 times. ``` #!/bin/bash x = "0" while [ $x -lt 10 ] do echo 'this is a test' x = $[$x + 1] done ``` [Read More]
Tags: linux bash