--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- YAMIS ------------------------- Don Oct 11 20:36:22 MEST 2001 ------------------------- yamis YAMIS Yet_Another_Machine_Information_Script yet_another_machine_informations_script machine /proc proc informations info Informationen informationen find cat Maschine maschine PC Computer computer ----------------------------------------------------------------------------- YAMIS bietet viele Informationen über die eigene Maschine. ----------------------------------------------------------------------------- YAMIS ist sehr einfach programmiert: Es zeigt einfach alle lesbaren Dateien unterhalb von /proc an: --------CODE--------: yamis #!/bin/bash # yamis - Yet Another Machine Information Script schows many informations about # - the machine you use # Copyright (C) Don Okt 11 20:38:00 MEST 2001 - now Ingo Blechschmidt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # # Ingo Blechschmidt # Arberstraße 5 # 86179 Augsburg # E-Mail: iblech@web.de, http://www.way.to/uselinux/ # Tel.: +49 / 821 882955 # # for i in `find /proc/ -type f -print`; do if [ -r $i ]; then echo "==> $i <==" cat $i echo fi done --------/CODE-------- Die Backticks (`) sorgen dafür, dass die Ausgabe von find dem for-Befehl übergeben wird. Mit dem -f Parameter für find übermittelt find nur Dateien, und mit dem -r Parameter für test ([ und ] ist ein shell-integriertes Alias für test) prüft es noch, ob die Datei lesbar ist. Wenn ja, wird sie, samt Überschrift, angezeigt. Eine Beispiel-Ausgabe (die Zeilenangaben wurden nachträglich eingefügt, mittels yamis | { a=0; while read; do a=`expr $a + 1`; echo "$a: $REPLY"; done; } ) ist siehe <"down/yamis.out">hier zu sehen (120 KB!). ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This document is distributed under the terms of the GNU Free Documentation License.