Category Archives: macosx

bash string manipulation

These quick string manipulations might save you some time. This works with bash starting from version 4.0 Function Input String s Bash Output String Show ABC123abc123 ${s} ABC123abc123 Show UPPERCASE ABC123abc123 ${s^^} ABC123ABC123 Show lowercase ABC123abc123 ${s,,} abc123abc123 Show length … Continue reading

Posted in bash, linux, macosx | Tagged , , , , | Leave a comment

Generate easy passwords

This script generates combinations of words to form a password. These passwords are easier to remember than true random garbage combinations, which can’t be remembered by anyone. Moreover the passwords are not dictionary words and too difficult to be guessed … Continue reading

Posted in bash, linux, macosx, regex, ubuntu | Tagged , , , , , | Leave a comment

Watermark all images

Recently I had to watermark around 500 images for an existing site. Images are replaced with watermarked images! I had problems with temporary/hidden images in the directory so the find statement contains a ! -name “.*” which negates hidden files … Continue reading

Posted in bash, find, linux, macosx, ubuntu | Tagged , , | Leave a comment

Get filename and or extension

This script uses the filename and the extension of a file using shell scripts. This is useful when you have to rename a file or its extension. filenameextension.shraw download  #!/bin/sh # Name: filenameextension.sh # Author: kdguntu@gmail.com # Function: Show filename … Continue reading

Posted in bash, cut, linux, macosx, ubuntu | Tagged , , , , , | Leave a comment