On Mit, 03 Jul 2002 at 20:54 (+0200), Thomas Templin wrote:
Hat jemand einen Tip für mich ob und wo ich ein run-parts àla Debian für SuSE finde. DESCRIPTION run-parts : run-parts runs a number of scripts or programs found in a single directory directory. Filenames should consist entirely of upper and lower case letters, digits, under scores, and hyphens. Subdirectories of directory and files with other names will be silently ignored.
Scripts must follow the #!/bin/interpretername convention in order to be executed. They will not automatically be executed by /bin/sh.
The files found will be run in the lexical sort order of the filenames.
Hmm, ich kenne run-parts nicht, aber das kann man doch auch relativ simpel auf Shell-Ebene machen: <ungetesteter Schnipsel> ls verzeichnis | while read f; do test -f "$f" || continue ftyp="`file -b $f`" if echo $ftyp | grep -q 'ELF 32-bit LSB executable'; then # Binary "verzeichnis/$f" elif echo $ftyp | grep -q 'perl script text'; then # Perl-Script $perl "$f" elif echo $ftyp | grep -q 'Bourne-Again shell script text'; then # Shell-Script $shell "$f" elif echo $ftyp | grep -q 'script text'; then # anderes Script: Interpreter holen prog="`head -1 \"$f\" | sed 's/^#!//'`" $prog "$f" # usw fi done Das klappt natürlich nur, wenn den Programmen / Scripts keine Parameter übergeben werden müssen (wobei ich mir nicht vorstellen kann, dass run-parts sowas berücksichtigt). BTW: Die Varianten für Shell und Perl oben sind etwas unsicher, file irrt sich manchmal auch. Vielleicht sollte man immer mit der letzten Variante arbeiten. Jan