for f in /*/datei.txt;
do
sed -n -e '/<host>/p' date.txt >> INFO
sed 's/<host>/'Hostname='/g' /root/INFO >> /root/INFO
sed 's/</host>/''/g' /root/INFO >> /root/INFO
done;
#!/bin/sh
DIR="/foo/bar/";
DAT="datei.xy";
find -H "$DIR" -name "$DAT" -print | while read i;
do
HOST=`grep "<host>" "$i" | awk -F"[<,>]" '{print $3}'`;
NET=`grep "<net>" "$i" | awk -F"[<,>]" '{print $3}'`;
echo "$HOST $NET";
done;
#!/bin/sh
DIR="/home/testing-suse/test/";
DAT="2.txt";
find -H "$DIR" -name "$DAT" -print | while read i;
do
HOST=`grep "<host>" "$i" | awk -F"[<,>]" '{print $3}'`;
NET=`grep "<net>" "$i" | awk -F"[<,>]" '{print $3}'`;
CDIR="${i%$DAT}";
echo "$HOST $NET $CDIR";
done;
for xmldir in /data/files/*; do ...
for i in [Ausdruck]; do echo "$i"; done;
#!/bin/sh
DIR="/home/testing-suse/test/";
DAT="2.txt";
find -H "$DIR" -name "$DAT" -print | while read i;
do
HOST=`grep "<host>" "$i" | awk -F"[<,>]" '{print $3}'`;
NET=`grep "<net>" "$i" | awk -F"[<,>]" '{print $3}'`;
CDIR="${i%$DAT}";
echo -e "Hostname: $HOST\nNIC: $NET" > "$CDIR/INFO";
done;
rmdir -v /dir/* 2> log.txt
Richtig.iea schrieb:Aber funktioniert das die Hauptsache