projects
/
fw
/
tmflights
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote branch 'origin/master'
[fw/tmflights]
/
fixeeprom
diff --git
a/fixeeprom
b/fixeeprom
index 34e8ac31112f7ea81eec589df8639dab91392d9c..82ecaf18b496c52679f045abff7689db6e637e13 100755
(executable)
--- a/
fixeeprom
+++ b/
fixeeprom
@@
-1,8
+1,15
@@
#!/bin/sh
for i in "$@"; do
num=`grep '^F' "$i" | awk '{printf ("%03d\n", strtonum("0x" $4))}'`
#!/bin/sh
for i in "$@"; do
num=`grep '^F' "$i" | awk '{printf ("%03d\n", strtonum("0x" $4))}'`
- newname=`echo "$i" | sed 's/flight-[0-9][0-9][0-9]/flight-'"$num"'/'`
- echo $num "$i" "$newname"
+ case "$num" in
+ "")
+ echo "$i: no flight number found" 1>&2
+ ;;
+ *)
+ newname=`echo "$i" | sed 's/flight-[0-9][0-9][0-9]/flight-'"$num"'/'`
+ echo $num "$i" "$newname"
+ ;;
+ esac
done | sort -rn | sed 's/^[0-9][0-9]*//' | while read old new; do
if [ $new = $old ]; then
:
done | sort -rn | sed 's/^[0-9][0-9]*//' | while read old new; do
if [ $new = $old ]; then
:
@@
-15,7
+22,7
@@
done | sort -rn | sed 's/^[0-9][0-9]*//' | while read old new; do
echo "$old: $new already exists"
fi
else
echo "$old: $new already exists"
fi
else
- mv $old $new
+
echo
mv $old $new
fi
fi
done
\ No newline at end of file
fi
fi
done
\ No newline at end of file