simple/truncate/configure

41 lines
842 B
Plaintext
Raw Permalink Normal View History

2000-08-23 15:03:42 +02:00
#!/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