Tag: bash
June 23, 2021
algorithms, BASH, bash script, Combination, math, Permutation, programming languages, Recursion, recursive, string
Swap Two Characters in BASH In BASH, we can use “${#string}” to get the length of a string. And in a function, we use “local” keyword to declare local …
I have quite a few servers, and deploying same files/folders to them is a problem. Then I come up with the following BASH script where I can just run …
April 24, 2021
awk, AWK, AWK programming, BASH, bash script, BASH Shell, batch script, linux, Shell Scripts, ubuntu
Disk high usage are one of the common cause of server down. Some administrators would create a 8GB empty file, and once the disk usage is exceeding a threshold, …
We can write a BASH Script to print out the current CPU frequency and temperature on Raspberry PI. #pi@raspberrypi:~ $ cat ./cpu_freq.sh #!/bin/bash temp=`head -n 1 /sys/class/thermal/thermal_zone0/temp | xargs …
December 9, 2020
algorithms, BASH, bash script, c / c++, c #, C/C++, C# (CSharp), java, Java, javascript, Node.Js, php, PHP, programming languages, python, Python, Rust, string, vbscript, VBScript
You are given a lowercase alphabet string text. Return a new string where every character in text is mapped to its reverse in the alphabet, so that a becomes …