Wednesday, October 20, 2010

Little Shell Scripting

1. Converting all .tif in directory to .tex files
name: convert_tif_tex.sh
content:
#!/bin/bash
for i in *.tif; do txmake -mode periodic -verbose "$i" "${i%.tif}.tex"; done

2. Downscaling geometry size all .tif files to 25% of original images. 
It making by "mogrify" utility - the part of ImageMagick pack.
name : mogrify_25prct_tif.sh
content:
#!/bin/bash
for i in *.tif; do mogrify -geometry 25% "$i" ; done

3. Converting .ui files from QTDesigner to PyQt .py 
name: ui2py.sh
content:
#!/bin/bash
name=`basename $1 .ui`
echo "------- $name ------"
pyuic4 ./$1 -o ./$name.py

No comments:

Post a Comment