2016-04-01 09:35:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Iterates over current directory, encodes all files with
|
|
|
|
# MacBinary but ensures that the dates are preserved
|
|
|
|
|
|
|
|
for i in *
|
|
|
|
do
|
2017-03-11 11:06:18 +00:00
|
|
|
if test -d "$i" ; then
|
|
|
|
cd "$i"
|
2020-01-04 22:19:00 +00:00
|
|
|
if [ "$(ls -A .)" ] ; then # directory is not empty
|
|
|
|
bash $0 "$1/$i"
|
|
|
|
fi
|
2017-03-11 11:06:18 +00:00
|
|
|
cd ..
|
|
|
|
else
|
2020-01-04 22:19:00 +00:00
|
|
|
echo -ne "$1/$i... \r"
|
2017-03-11 11:06:18 +00:00
|
|
|
macbinary encode "$i"
|
|
|
|
touch -r "$i" "$i.bin"
|
|
|
|
mv "$i.bin" "$i"
|
|
|
|
fi
|
2016-04-01 09:35:00 +00:00
|
|
|
done
|
2017-03-11 11:06:18 +00:00
|
|
|
|
|
|
|
# on the top level we want to print a new line
|
2020-01-04 22:19:00 +00:00
|
|
|
if test -z "$1" ; then
|
2017-03-11 11:06:18 +00:00
|
|
|
echo
|
|
|
|
fi
|