mirror of
https://codeberg.org/scip/note.git
synced 2025-12-16 20:21:04 +01:00
FIXED: there were some odd bugs in commandline parsing, some options were unavailable.
FIXED: Forgot "PreferredEditor" config-option in the new config format.
FIXED: the interactive "cd .." command has ignored the presence of a
"DefaultLong" setting(and search too)... thx to Peter.
CHANGED: Optimized a little bit the output routine, now it is better to read.
ADDED: sub format and appropriate config-option for text formatting capabilities.
CHANGED: changed getconfig regexp, which allows now also to use Option = Param.
FIXED: was not possible to override config-options, which are set by default to
something.
ADDED: note chacks now, if a database os actually really encrypted and exits with
an error if it s and the user turned off encryption. This protects her from
destroying it's own database ..
This commit is contained in:
16
Changelog
16
Changelog
@@ -1,5 +1,21 @@
|
||||
==================================================================================
|
||||
|
||||
1.0.6:
|
||||
FIXED: there were some odd bugs in commandline parsing, some options were unavailable.
|
||||
FIXED: Forgot "PreferredEditor" config-option in the new config format.
|
||||
FIXED: the interactive "cd .." command has ignored the presence of a
|
||||
"DefaultLong" setting(and search too)... thx to Peter.
|
||||
CHANGED: Optimized a little bit the output routine, now it is better to read.
|
||||
ADDED: sub format and appropriate config-option for text formatting capabilities.
|
||||
CHANGED: changed getconfig regexp, which allows now also to use Option = Param.
|
||||
FIXED: was not possible to override config-options, which are set by default to
|
||||
something.
|
||||
ADDED: note chacks now, if a database os actually really encrypted and exits with
|
||||
an error if it s and the user turned off encryption. This protects her from
|
||||
destroying it's own database ..
|
||||
|
||||
==================================================================================
|
||||
|
||||
1.0.5:
|
||||
FIXED: the T (and t respectively) printed nothing out since 1.0.3! It does
|
||||
it now again...
|
||||
|
||||
38
README
38
README
@@ -1,4 +1,4 @@
|
||||
note 1.0.5 by Thomas Linden, 14/05/2000
|
||||
note 1.0.6 by Thomas Linden, 18/05/2000
|
||||
=======================================
|
||||
|
||||
Introduction
|
||||
@@ -292,6 +292,36 @@ Topics
|
||||
|
||||
|
||||
|
||||
|
||||
Formatting of notes
|
||||
===================
|
||||
|
||||
Another very nice feature is the possibility to format the note-text (as much as
|
||||
shell allows it). First, you can use the note-internal "magic-strings" for color-
|
||||
izing. Those strings looks much like HTML:
|
||||
"<green>here is a green line of text</green> no more green."
|
||||
As you see, the beginning of another color starts with a tag(kinda) of the color
|
||||
<colorname> and ens with an end tag </colorname>.
|
||||
|
||||
The following colors are available:
|
||||
black, red, green, yellow, blue, magenta, cyan and white.
|
||||
|
||||
Beside colorizing text, you can also create bold or underlined text! If you decide
|
||||
to use this (additional) feature, you need to set the Config-Option "FormatNotes"
|
||||
to 1 which turns it on.
|
||||
Usage is very straightforward, if a word (a word is defined as some text with at least
|
||||
one space surrounded) is between a magic mark-character. Here are the available
|
||||
things, you can do:
|
||||
|
||||
bold: **word**
|
||||
underlined: __word__
|
||||
inverse: {{word}}
|
||||
|
||||
The text will be formatted using the actually note-color.
|
||||
|
||||
|
||||
|
||||
|
||||
Scripting
|
||||
=========
|
||||
|
||||
@@ -326,8 +356,8 @@ Scripting
|
||||
Format of the notedb (binary backend)
|
||||
=====================================
|
||||
|
||||
The database where the notes are stored is a binary file of
|
||||
the following format:
|
||||
The database where the notes are stored is a binary fixed record length file
|
||||
of the following format:
|
||||
It consists of three fixed length fields per entry. The fields
|
||||
have the following types:
|
||||
o Number: Integer (1 byte)
|
||||
@@ -484,4 +514,4 @@ Contributors / Credits
|
||||
Last changed
|
||||
============
|
||||
|
||||
14/05/2000
|
||||
18/05/2000
|
||||
|
||||
169
bin/note
169
bin/note
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/perl
|
||||
# $Id: note,v 1.26 2000/05/13 01:05:17 thomas Exp thomas $
|
||||
# $Id: note,v 1.27 2000/05/16 23:51:35 thomas Exp thomas $
|
||||
#
|
||||
#
|
||||
# note - console notes management with database and encryption support.
|
||||
@@ -71,7 +71,7 @@ my (
|
||||
# options from config file .noterc
|
||||
#
|
||||
$maxlen, $timelen, $TOPIC, $NOTEDB, $MAX_TIME, $PreferredEditor,
|
||||
$ALWAYS_INT, $KEEP_TIMESTAMP, $COLOR, $ALWAYS_EDIT, $HOME,
|
||||
$ALWAYS_INT, $KEEP_TIMESTAMP, $COLOR, $ALWAYS_EDIT, $HOME, $FormatText,
|
||||
$BORDER_COLOR, $NOTE_COLOR, $NUM_COLOR, $TOPIC_COLOR, $MAX_NOTE,
|
||||
$USE_CRYPT, $CRYPT_METHOD, $TopicSep, $DEFAULT_LIST, $TIME_COLOR,
|
||||
|
||||
@@ -126,7 +126,7 @@ $TIME_COLOR = "black";
|
||||
$TOPIC_COLOR = "BLACK";
|
||||
$TOPIC = 1;
|
||||
$TopicSep = '/';
|
||||
$version = "1.0.5";
|
||||
$version = "1.0.6";
|
||||
if($TOPIC)
|
||||
{
|
||||
$CurDepth = 1; # the current depth inside the topic "directory" structure...
|
||||
@@ -159,11 +159,11 @@ else
|
||||
"delete|d=s" => \$opt_d, # integer, required
|
||||
"search|s=s" => \$opt_s, # string, required
|
||||
"tree|topic|t!" => \$opt_t, # no arg
|
||||
"long_tree|T!" => \$opt_T, # no arg
|
||||
"longtopic|T!" => \$opt_T, # no arg
|
||||
"list|l:s" => \$opt_l, # string, optional
|
||||
"long_list|L:s" => \$opt_L, # string, optional
|
||||
"dump|D:s" => \$opt_D, # string, optional
|
||||
"import|I:s" => \$opt_I, # string, optional
|
||||
"longlist|L:s" => \$opt_L, # string, optional
|
||||
"dump||Dump|D:s" => \$opt_D, # string, optional
|
||||
"import|Import|I:s" => \$opt_I, # string, optional
|
||||
"overwrite|o!" => \$opt_o, # no arg
|
||||
"help|h|?!" => \$opt_h, # no arg
|
||||
"version|v!" => \$opt_v # no arg
|
||||
@@ -349,7 +349,7 @@ $NoteKey = $TopicSep . "notes" . $TopicSep;
|
||||
|
||||
if($ListType ne "LONG" && $mode ne "interactive")
|
||||
{
|
||||
$maxlen += $timelen; # no time will be displayed!
|
||||
#$maxlen += $timelen; # no time will be displayed!
|
||||
}
|
||||
|
||||
|
||||
@@ -381,9 +381,9 @@ if($USE_CRYPT eq "YES" && $NOTEDB::crypt_supported == 1) {
|
||||
$db->use_crypt($key,$CRYPT_METHOD);
|
||||
undef $key;
|
||||
# verify correctness of passwd
|
||||
my ($note, $date) = $db->get_single(1);
|
||||
if($date ne "") {
|
||||
if($date !~ /^\d+\.\d+?/) {
|
||||
my ($cnote, $cdate) = $db->get_single(1);
|
||||
if($cdate ne "") {
|
||||
if($cdate !~ /^\d+\.\d+?/) {
|
||||
print "access denied.\n"; # decrypted $date is not a number!
|
||||
exit(1);
|
||||
}
|
||||
@@ -391,7 +391,14 @@ if($USE_CRYPT eq "YES" && $NOTEDB::crypt_supported == 1) {
|
||||
}
|
||||
else {
|
||||
$db->no_crypt;
|
||||
# does: NOTEDB::crypt_supported = 0;
|
||||
# does: NOTEDB::crypt_supported = 0;
|
||||
my ($cnote, $cdate) = $db->get_single(1);
|
||||
if($cdate ne "") {
|
||||
if($cdate !~ /^\d+\.\d+?/) {
|
||||
print "$NOTEDB seems to be encrypted!\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# main loop: ###############
|
||||
@@ -477,7 +484,6 @@ sub display
|
||||
sub search
|
||||
{
|
||||
my($n,$match,$note,$date,$num,%res);
|
||||
$maxlen += $timelen;
|
||||
if($searchstring eq "")
|
||||
{
|
||||
print "No searchstring specified!\n";
|
||||
@@ -507,8 +513,11 @@ sub list
|
||||
my(@topic,@RealTopic, $i,$t,$n,$num,@CurItem,$top,$in,%res);
|
||||
if($mode ne "interactive" && !$Raw)
|
||||
{
|
||||
print "List of all existing notes:\n\n";
|
||||
print "\nList of all existing notes:\n\n";
|
||||
}
|
||||
else {
|
||||
print "\n";
|
||||
}
|
||||
|
||||
# list all available notes (number and firstline)
|
||||
%res = $db->get_all();
|
||||
@@ -858,9 +867,8 @@ sub import
|
||||
|
||||
sub interactive
|
||||
{
|
||||
my($maxlen_save, $B, $BB, $menu, $char, @LastTopic, $Channel);
|
||||
my($B, $BB, $menu, $char, @LastTopic, $Channel);
|
||||
$Channel = $|;
|
||||
$maxlen_save = $maxlen;
|
||||
# create menu:
|
||||
$B = "<blackI>";
|
||||
$BB = "</blackI>";
|
||||
@@ -876,14 +884,13 @@ sub interactive
|
||||
. $B . "Q" . $BB . "-Quit] "; # $CurTopic will be empty if $TOPIC is off!
|
||||
# per default let's list all the stuff:
|
||||
# Initially do a list command!
|
||||
$maxlen += $timelen if($DEFAULT_LIST ne "LONG");
|
||||
print "\n";
|
||||
$ListType = ($DEFAULT_LIST eq "LONG") ? "LONG" : "";
|
||||
&list;
|
||||
undef $SetTitle;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
$ListType = "";
|
||||
$maxlen = $maxlen_save;
|
||||
$ListType = ($DEFAULT_LIST eq "LONG") ? "LONG" : "";
|
||||
undef $SetTitle;
|
||||
if($CurDepth > 2)
|
||||
{
|
||||
print C $menu . $TOPICC . "../" . $CurTopic . $_TOPICC . ">";
|
||||
@@ -899,35 +906,28 @@ sub interactive
|
||||
chomp $char;
|
||||
if($char =~ /^\d+\s*[\di*?,*?\-*?]*$/)
|
||||
{
|
||||
$ListType = ""; #overrun
|
||||
# display notes
|
||||
$maxlen += $timelen;
|
||||
$number = $char;
|
||||
&display;
|
||||
undef $SetTitle;
|
||||
}
|
||||
elsif($char =~ /^n$/i)
|
||||
{
|
||||
# create a new one
|
||||
&new;
|
||||
}
|
||||
elsif($char =~ /^l$/ || $char =~ /^$/)
|
||||
elsif($char =~ /^$/)
|
||||
{
|
||||
# list
|
||||
print "\n";
|
||||
if($DEFAULT_LIST eq "LONG" && $char =~ /^$/) {
|
||||
$ListType = "LONG";
|
||||
}
|
||||
else {
|
||||
$ListType = "";
|
||||
$maxlen += $timelen;
|
||||
}
|
||||
&list;
|
||||
undef $SetTitle;
|
||||
}
|
||||
elsif($char =~ /^l$/)
|
||||
{
|
||||
$ListType = "";
|
||||
&list;
|
||||
}
|
||||
elsif($char =~ /^L$/)
|
||||
{
|
||||
$ListType = "LONG";
|
||||
print "\n";
|
||||
&list;
|
||||
undef $SetTitle;
|
||||
}
|
||||
@@ -1005,10 +1005,7 @@ sub interactive
|
||||
{
|
||||
$CurDepth-- if ($CurDepth > 1);
|
||||
$CurTopic = $LastTopic[$CurDepth];
|
||||
$maxlen += $timelen;
|
||||
print "\n";
|
||||
&list;
|
||||
undef $SetTitle;
|
||||
}
|
||||
elsif($char =~ /^l\s+(\w+)$/)
|
||||
{
|
||||
@@ -1020,11 +1017,9 @@ sub interactive
|
||||
$LastTopic[$CurDepth] = $CurTopic;
|
||||
$CurTopic = $1;
|
||||
$CurDepth++;
|
||||
print "\n";
|
||||
$ListType = "";
|
||||
$maxlen += $timelen;
|
||||
&list;
|
||||
undef $SetTitle;
|
||||
|
||||
&list;
|
||||
|
||||
$CurTopic = $LastTopic[$CurDepth];
|
||||
$CurDepth--;
|
||||
%TP = %SaveTP;
|
||||
@@ -1044,11 +1039,8 @@ sub interactive
|
||||
$char = $unchar if(exists $TP{$unchar});
|
||||
$LastTopic[$CurDepth] = $CurTopic;
|
||||
$CurTopic = $char;
|
||||
$maxlen += $timelen;
|
||||
$CurDepth++;
|
||||
print "\n";
|
||||
&list;
|
||||
undef $SetTitle;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1111,23 +1103,49 @@ Options:
|
||||
#print "called from line $line\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
sub find_editor {
|
||||
return $PreferredEditor || $ENV{"VISUAL"} || $ENV{"EDITOR"} || "vim" || "vi" || "pico";
|
||||
}
|
||||
|
||||
#/
|
||||
|
||||
sub format {
|
||||
# make text bold/underlined/inverse using current $NOTEC
|
||||
# s/\[([^]]*)\]/$param{$1}/g;
|
||||
my($note) = @_;
|
||||
if($FormatText) {
|
||||
my $BN = uc($NOTEC);
|
||||
my $_BN = uc($_NOTEC);
|
||||
my $UN = $NOTEC;
|
||||
$UN =~ s/<(.*)>/<$1_>/;
|
||||
my $_UN = $UN;
|
||||
$_UN =~ s/<(.*)>/<\/$1>/;
|
||||
my $IN = $NOTEC; my $_IN = $_NOTEC;
|
||||
$IN =~ s/<(.*)>/<$1I>/;
|
||||
$_IN =~ s/<(.*)>/<$1I>/;
|
||||
#$note =~ s/ (\*)(.+)(\*) / $BN$2$_BN /g;
|
||||
#$note =~ s/ (_)(.+)(_) / $UN$2$_UN /g;
|
||||
#$note =~ s/ (\/)(.+)(\/) / $IN$2$_IN /g;
|
||||
$note =~ s/\*\*([^\*^\*]*)\*\*/$BN$1$_BN/g;
|
||||
$note =~ s/__([^_^_]*)__/$UN$1$_UN/g;
|
||||
$note =~ s/{{([^}^}]*)}}/$IN$1$_IN/g;
|
||||
}
|
||||
$note =~ s/(<\/.*>)/$1$NOTEC/g;
|
||||
$note;
|
||||
}
|
||||
|
||||
sub output
|
||||
{
|
||||
my($SSS, $LINE, $num, $note, $time, $TYPE, $L, $LONGSPC, $R, $PathLen, $SP, $title, $CUTSPACE,
|
||||
$len, $diff, $Space, $nlen);
|
||||
$len, $diff, $Space, $nlen, $txtlen);
|
||||
($num, $note, $time, $TYPE) = @_;
|
||||
if($ListType ne "LONG")
|
||||
{
|
||||
$SSS = "-" x ($maxlen + 31 - $timelen);
|
||||
}
|
||||
else
|
||||
{
|
||||
$SSS = "-" x ($maxlen + 31);
|
||||
}
|
||||
$txtlen = ($ListType eq "LONG") ? $maxlen : $timelen + $maxlen;
|
||||
|
||||
$note = &format($note);
|
||||
|
||||
$SSS = "-" x ($maxlen + 31);
|
||||
|
||||
$nlen = length("$num");
|
||||
$LINE = "$BORDERC $SSS $_BORDERC\n";
|
||||
$L = $BORDERC . "[" . $_BORDERC;
|
||||
@@ -1140,14 +1158,7 @@ sub output
|
||||
{
|
||||
$SP = "";
|
||||
# print only if it is the first line!
|
||||
if($ListType ne "LONG")
|
||||
{
|
||||
$SP = " " x ($maxlen-2 - $timelen - $PathLen);
|
||||
}
|
||||
else
|
||||
{
|
||||
$SP = " " x ($maxlen-2 - $PathLen);
|
||||
}
|
||||
$SP = " " x ($maxlen - 2 - $PathLen);
|
||||
if(!$Raw) {
|
||||
# no title in raw-mode!
|
||||
print C $LINE;
|
||||
@@ -1175,12 +1186,12 @@ sub output
|
||||
$SetTitle = 1;
|
||||
}
|
||||
$title = "";
|
||||
$CUTSPACE = " " x $maxlen;
|
||||
$CUTSPACE = " " x $txtlen;
|
||||
$note =~ s/\n/$CUTSPACE/g;
|
||||
$len = length($note);
|
||||
if($len < ($maxlen - 2 - $nlen))
|
||||
if($len < ($txtlen - 2 - $nlen))
|
||||
{
|
||||
$diff = $maxlen - $len;
|
||||
$diff = $txtlen - $len;
|
||||
$Space = " " x $diff;
|
||||
if(!$Raw) {
|
||||
if($num eq "-")
|
||||
@@ -1198,7 +1209,7 @@ sub output
|
||||
}
|
||||
else
|
||||
{
|
||||
$title = substr($note,0,($maxlen - 2 - $nlen));
|
||||
$title = substr($note,0,($txtlen - 2 - $nlen));
|
||||
if(!$Raw) {
|
||||
$title = $BORDERC . $NOTEC . "\"" . $title . "...\"$_NOTEC$_BORDERC";
|
||||
}
|
||||
@@ -1226,10 +1237,7 @@ sub output
|
||||
{
|
||||
# we will not reach this in raw-mode, therefore no decision here!
|
||||
chomp $note;
|
||||
$Space = " " x ($maxlen - 16);
|
||||
$SP = " " x ($maxlen + 13);
|
||||
#print C $LINE;
|
||||
#print C "$L $NUMC#$_NUMC " . $TIMEC . "creation date$_TIMEC$SP$R\n";
|
||||
$Space = " " x (($maxlen + $timelen) - 16);
|
||||
print C $LINE;
|
||||
print C "$L $NUMC$num$_NUMC $R$L$TIMEC$time$_TIMEC $Space$R\n";
|
||||
print C $LINE;
|
||||
@@ -1496,7 +1504,7 @@ sub getconfig
|
||||
while(<CONFIG>) {
|
||||
chomp;
|
||||
next if(/^\s*$/ || /^\s*#/);
|
||||
my ($option,$value) = split /\s\s*/, $_, 2;
|
||||
my ($option,$value) = split /\s\s*=?\s*/, $_, 2;
|
||||
$value =~ s/\s*$//;
|
||||
$home = $value if (/^Home/);
|
||||
$libpath = $value if (/^LibPath/);
|
||||
@@ -1512,23 +1520,31 @@ sub getconfig
|
||||
$NOTEDB = $value if (/^NoteDb/);
|
||||
$MAX_NOTE = $value if (/^MaxNoteByte/);
|
||||
$MAX_TIME = $value if (/^MaxTimeByte/);
|
||||
$CRYPT_METHOD = $value if (/^CryptMethod/);
|
||||
$USE_CRYPT = "YES" if (/^UseEncryption/ && $value == 1);
|
||||
$CRYPT_METHOD = $value if (/^CryptMethod/);
|
||||
$USE_CRYPT = undef if (/^UseEncryption/ && $value == 0);
|
||||
$ALWAYS_INT = "YES" if (/^AlwaysInteractive/ && $value == 1);
|
||||
$ALWAYS_INT = undef if (/^AlwaysInteractive/ && $value == 0);
|
||||
$DEFAULT_LIST = "LONG" if (/^DefaultLong/ && $value == 1);
|
||||
$DEFAULT_LIST = undef if (/^DefaultLong/ && $value == 0);
|
||||
$ALWAYS_EDIT = "YES" if (/^AlwaysEditor/ && $value == 1);
|
||||
$ALWAYS_EDIT = undef if (/^AlwaysEditor/ && $value == 0);
|
||||
$KEEP_TIMESTAMP = "YES" if (/^KeepTimeStamp/ && $value == 1);
|
||||
$KEEP_TIMESTAMP = undef if (/^KeepTimeStamp/ && $value == 0);
|
||||
$COLOR = "YES" if (/^UseColors/ && $value == 1);
|
||||
$COLOR = "NO" if (/^UseColors/ && $value == 0);
|
||||
$TopicSep = $value if (/^TopicSeparator/);
|
||||
$maxlen = $value if (/^MaxLen/);
|
||||
$COLOR = "YES" if (/^UseColors/ && $value == 1);
|
||||
$BORDER_COLOR = $value if (/^BorderColor/);
|
||||
$NUM_COLOR = $value if (/^NumberColor/);
|
||||
$NOTE_COLOR = $value if(/^NoteColor/);
|
||||
$TIME_COLOR = $value if (/^TimeColor/);
|
||||
$TOPIC_COLOR = $value if (/^TopicColor/);
|
||||
$PreferredEditor = $value if (/^PreferredEditor/);
|
||||
$FormatText = $value if (/^FormatText/);
|
||||
}
|
||||
chomp $home;
|
||||
$home =~ s/\/*$//;
|
||||
$home =~ s/\/*$//; # cut eventually / at the end
|
||||
$HOME = eval($home);
|
||||
if($NOTEDB =~ /^(~\/)(.*)$/) {
|
||||
$NOTEDB = "/home/" . $USER . "/" . $2;
|
||||
@@ -1544,6 +1560,9 @@ sub getconfig
|
||||
__END__
|
||||
#
|
||||
# $Log: note,v $
|
||||
# Revision 1.27 2000/05/16 23:51:35 thomas
|
||||
# fixed many option-parsing related bugd!
|
||||
#
|
||||
# Revision 1.26 2000/05/13 01:05:17 thomas
|
||||
# changed config format and fixed some bugs
|
||||
# as well as some other additions...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# 1.0.5 -*- sh -*-
|
||||
# 1.0.6 -*- sh -*-
|
||||
# This is a sample config for the note script
|
||||
# There are useful defaults set in note itself.
|
||||
#
|
||||
@@ -137,6 +137,11 @@ TopicColor BLACK
|
||||
# for inverted color append an "I" (greenI will be inverted green)
|
||||
|
||||
|
||||
# Additional to colors, you can also do a little bit of formatting your
|
||||
# notes (bold, underlined, italic), see README!
|
||||
# You need to set this Option to 1, if you decide to make use of this
|
||||
# capabily
|
||||
FormatText 1
|
||||
|
||||
# That's all about it for now.
|
||||
# If you still have any questiosn, please feel free to contact
|
||||
|
||||
55
stresstest.sh
Executable file
55
stresstest.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user