Files
note/bin/stresstest.sh

56 lines
1.0 KiB
Bash
Raw Permalink Normal View History

CHANGED: using Makemaker instead of self-written code in Makefile.PL for installation. No more dependency checks built-in because note runs out-of-the-box without additional modules, as a matter fact. ADDED: if a search matches exactly on one note it will be displayed directly, which avoids typing. CHANGED: the main if-else contruct for calling the several subs has been replaced by a simple closure call. CHANGED: notes will now displayed in a slightly simpler fashion in interactive mode, without the separator line between the title and the note. ADDED: note can now determine automatically the width and height of the terminal window it runs in (in interactive mode only) and sets the width/height of what it prints accordingly. the config variable "MaxLen" must be set to "auto" (which is the default from now on) to get this to work. ADDED: any interactive command will now clear the screen before it does anything. this look much more uncluttered. ADDED: if multiple notes are printed at once (i.e. note 1,2) then the separator line between them will no more being printed because every notes title is preceded by a line anyway. CHANGED: by default the default operation mode is now interactive mode, which is somewhat kindlier to new users. CHANGED: changed to order which editor note tries to find. vi got now higher precedence, because it is likely installed on almost any unix system. CHANGED: cosmetics. NOTE: increased minor version number from 1 to 2 to indicate that development begun after 2 1/2 years pause again :-)
2012-02-10 20:27:05 +01:00
#!/bin/sh
# create notes with topics which then represents the corresponding
# directory structure. Depending on how many files the directory
# contains, the resulting note-database may become very large.
# It will then have thousands of notes!
STARTDIR=$1
case $STARTDIR in
"")
echo "usage: stresstest.sh <directory>"
exit 1
;;
*)
LOCPFAD=`echo $STARTDIR | grep "^[a-zA-Z0-9.]"`
case $LOCPFAD in
"")
#echo nix
;;
*)
STARTDIR=`echo $STARTDIR | sed 's/^\.*//'`
STARTDIR="`pwd`/$STARTDIR"
STARTDIR=`echo $STARTDIR | sed 's/\/\//\//g'`
;;
esac
;;
esac
stress ()
{
FILES=""
for file in `ls $1|sort`
do
echo "$1/$file"
if [ -d "$1/$file" ] ; then
stress "$1/$file"
else
#echo "$1/" > /tmp/$$
#echo $file >> /tmp/$$
#`cat /tmp/$$ | note -`
FILES="$FILES $file"
fi
done
echo "$1/" > /tmp/$$
echo "$FILES" >> /tmp/$$
case $FILES in
"")
;;
*)
RES=`cat /tmp/$$ | note -`
;;
esac
FILES=""
}
stress $STARTDIR