41 lines
842 B
Plaintext
41 lines
842 B
Plaintext
|
#!/bin/sh
|
||
|
#
|
||
|
echo "#!/bin/sh" > customize.$$
|
||
|
echo "sed \\" > customize.$$
|
||
|
chmod +x customize.$$
|
||
|
|
||
|
################################################################
|
||
|
# find a find which understands -printf
|
||
|
# (like gnu find)
|
||
|
#
|
||
|
now=`date '+%Y%m%d' `
|
||
|
touch find_printf.$now.$$
|
||
|
|
||
|
for i in /usr/bin/find /usr/local/bin/find
|
||
|
do
|
||
|
ts=`$i find_printf.$now.$$ -printf '%TY%Tm%Td\n'`
|
||
|
if [ "x$ts" = "x$now" ]
|
||
|
then
|
||
|
echo $i works
|
||
|
find_printf="$i"
|
||
|
break
|
||
|
fi
|
||
|
done
|
||
|
if [ -z "$find_printf" ]
|
||
|
then
|
||
|
echo could not find a working find_printf command, sorry.
|
||
|
exit 1
|
||
|
fi
|
||
|
echo " -e 's,@@@find_printf@@@,$find_printf,g' \\" >> customize.$$
|
||
|
rm find_printf.$now.$$
|
||
|
|
||
|
|
||
|
################################################################
|
||
|
# finish
|
||
|
# Add trailing newline and rename temp file to final name
|
||
|
#
|
||
|
echo >> customize.$$
|
||
|
|
||
|
mv customize.$$ customize
|
||
|
|