Linux

Improved watermark script with imagemagick

#!/bin/bash # Use a shell loop #mkdir thumbnails if [ ! -f *.JPG ] ; then echo “Ingen filer tilgjengelig!” else for file in *.JPG do width=`identify -format %w ${file}`; \ convert -background ‘#0008’ -fill white -gravity center -size ${width}x90 \ -font Sketchy -pointsize 50 \ caption:”Copyright © 2007 Pario.no” \ +size ${file} +swap -gravity […]

Read More
Linux

Resize of images in a folder with imagemagick

#!/bin/bash # Hans-Henry Jakobsen # Script som bl.a resizer bilder og legger de i rett mappe # NB! ikke bruk originalfil da dette script sletter fila # Sjekker at mapper eksisterer if [ ! -d 320 ] then mkdir 320 fi if [ ! -d 480 ] then mkdir 480 fi for file in $(ls|grep […]

Read More
Scripting

Shell script utility to read a file line by line

#!/bin/bash # # Shell script utility to read a file line line version 2 # This is simpler version of readline script # This script also demonstrate how to process data file # line by line and then separate line in fields, so that # you can process it according to your need. # # […]

Read More
Scripting

Reverse text content in file

#!/bin/bash # Bash shell script to reverse text file contain i.e. concatenate files and # print on the standard output in reverse. This script also demonstrate how # to use arrays under bash shell script. FILE=”$1″ if [ $# -eq 0 ]; then echo “$(basename $0) – file-name” exit 1 fi textArray[0]=”” # hold text […]

Read More