#!/bin/bash # rotate # rotates file $2 by $1 degrees # for negative angles needs "0" : -0.4 # the resulting file has the statement $1degrees_ before the old file name # this is useful if one has a small rotation to make to "straighten" a photograph # one can quickly try a series of small rotations -0.4, -0.5 etc # example of usage: # rotate -0.4 panda.png ==> -0.4degrees_panda.png # keeps original, because name is changed #1 refers to the number of degrees to rotate. # only one file, viz. $2, is involved convert -rotate $1 $2 $1degrees_$2