Received: from dns.netbusiness.it (dns.netbusiness.it [194.184.167.2]) by pisoft.it (8.8.5/8.8.5) with ESMTP id WAA04189 for ; Tue, 12 Jan 1999 22:24:40 +0100 Received: from fastidio.manzonet (IDENT:postfix@m-bovolone11.netbusiness.it [195.120.222.140]) by dns.netbusiness.it (8.9.2/8.9.2) with ESMTP id WAA00867 for ; Tue, 12 Jan 1999 22:24:36 +0100 (MET) Received: by fastidio.manzonet (Postfix, from userid 500) id C7FCE9A64; Tue, 12 Jan 1999 22:21:42 +0100 (CET) Message-ID: <19990112222142.A2372@fastidio.manzonet> Date: Tue, 12 Jan 1999 22:21:42 +0100 From: Andrea Manzini To: Michele Andreoli Subject: mu-find 0.0.1 pre-alpha ;-) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2 X-UIDL: 5a1464b2274a468da8651dc0d6c0f749 Status: RO Content-Length: 1160 Lines: 46 Ecco qua, ti invito a provarlo e a riferirmi bug, anomalie e possibili miglioramenti; prossimamente spero di riuscire ad inserire le opzioni "numeriche" (ricerca sulla dimensione del file e sulle date)... Se la morosa non protesta troppo |-) %% cut here %% #!/bin/ash # muFind 0.0.1 by Andrea Manzini case $1 in -name|-user) P="." ;; -h|--help) echo "Usage: find [path] [regexp]" echo "warning: filename regexp is greedy. I.E. foo will match *foo*" exit ;; *) P="$1"; shift ;; esac case $1 in -name) /bin/ls $P -1UAR 2> /dev/null | sed -n "/:$/P" | tr -d ':' | while read D ; do /bin/ls $D -1UA 2> /dev/null | sed -n "/$2/P" | while read F; do if [ "$D" = '/' ] ; then echo "/$F" else echo "$D/$F" fi done done ;; -user) /bin/ls $P -FURAo 2> /dev/null | sed -n "/ \+$2 \+/P" ;; *) echo "Error: no valid command specified" echo "Valid commands are: -name -user" ;; esac %% cut here %% -- Andrea Manzini | "D'ogni cosa la parte ritiene in se' la linux@netbusiness.it | natura del tutto" (Leonardo da Vinci)