Project

General

Profile

RE: Trap or suppress warnings when using Exiv2 library? ยป exivate.sh.txt

Steve Wright, 01 Oct 2010 13:26

 
1
#!/bin/bash
2
SAVEIFS=$IFS
3
IFS=$(echo -en "\n\b")
4

    
5
while read 'line';
6
do
7
	file=$(basename "$line")
8
	echo -e "Checking to see if Exiv2 likes $file."
9
	exiv2 -pi $line 1>>fileinfo.txt 2>>errorbucket2.text
10
	r=$(cat errorbucket2.text | grep Error)
11
	if [[ "$r" != "" ]]; then
12
		echo -ne "$line\n$r\n">>errorbucket.txt
13
	fi
14
	s=$(cat errorbucket2.text | grep Warning)
15
	if [[ "$s" != "" ]]; then
16
		echo -ne "$line\n$s\n">>errorbucket.txt
17
	fi
18
	rm errorbucket2.text
19
	touch errorbucket2.text
20

    
21
done<likedislikelist
    (1-1/1)