bash
image ordering by Original Date Time using bash script
2016/01/05
Here is the script: #!/bin/bash - #=============================================================================== # # FILE: imgOrg.sh # # USAGE: ./imgOrg.sh # # DESCRIPTION: # # OPTIONS: --- # …
How to verify sha256sum for multiple file or one file.
2015/10/30
So, lets say you have downloaded the SHA256SUMS files. This file contains the sha256sum for multiple files and you want to compare the values for only one or some of them, then the simplest thing you …
Get count of lines in scripts (shell)
2015/10/15
If you have tried to get the count of lines in file, the you would know about “nl” or “wc -l”. But as you are aware these give you number of lines with other details as well and you need to post …
bash – expand shell variables ( bash bug resolved )
2015/08/17
As you would have noticed in the recent versions of bash, expansion does not work properly when expanding directory names. So, for something like this cd $varname if you press tab, then variable name …
ShellCheck – check basic POSIX shell script errors
2015/08/03
Here is description of the tool: […] To install dnf install ShellCheck And just run the tool on the script to get the common errors.
nice little bash function to search for running processes
2014/10/13
Here is a nice little handy function that I use very regurlarly. You can use this function with parameter to just grep for that or just type psa to see all the running processes. Just put this in your …
bash – refer the first parameter from last command quickly
2014/09/22
To refer to first parameter from the last command quickly, you can use !^ Note: This can also be referred as “!!:1“
bash refer parameters from the current command
2014/09/15
In bash you can use !# to refer to any parameter from the current command, example:
Debuggging bash cron scripts.
2014/09/01
I have to several times debug scripts that I get complain about working when logging in normally but they do not work when run in cron mode. So, quite a lot of times, redirecting the stderr of the …
ldap search function
2014/08/25
First you will need the ldap search utility. The client for ldap search comes in openldap-clients, so you need to install that first: sudo yum install openldap-clients Now, that you have installed it, …
get all the urls in html file (local or on server).
2014/02/17
To use this, you will need the lynx tool, so install that first. sudo yum install lynx Now, to get list of all the URLs in local html file or some URL, just execute this: lynx -dump -listonly Related …
bash debug – log all executed commands
2014/02/03
Whenever I am writing a script in perl or bash, I always wish that there was some way to have all the commands logged or output to screen. I know there is “set -x” option to have debugging enabled, …