🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: ch.comp.os.linux
Article #18176

Problem mit grep-Umleitung in shellscript

#18176
From: Joerg Hau
Date: Mon, 03 Apr 2000 00:00
45 lines
1765 bytes
Hi,

Habe ein Problem mit der Umleitung von 'grep' in eine Datei. Ich moechte
in einem shell-script den Inhalt von Konfigurationsdateien (hier nur 1)
so auflisten, dass die Kommentarzeilen rausgefiltert werden. Wenn ich
unter tcsh 

    /bin/cat /etc/rc.config | grep -v ^# | grep "="

eingebe, laeuft das auch wie geplant ... aber in dem untenstehenden
script (was das gleiche tun soll) geht das _nicht_; die Zeile mit "grep"
liefert keinen Output!

--- snip ---
#! /bin/tcsh
onintr cleanup
set pfile = ("/etc/rc.config")

echo "Configuration of "$HOSTNAME", as of "`date`"." 
echo " " 		

foreach i ($pfile)
	echo " "
	echo "*** "$i " ***"	
	echo " "  	
	echo $i
	cat $i | grep -v ^# | grep "="
	echo " "	
end

cleanup:
exit 0
--- snip ---


.. was hab' ich da uebersehen? Bin fuer jeden Tip dankbar!

-- Joerg



------------------------------------------------------------
 joerg.hau(at)swissonline.ch * Lausanne, Switzerland
 Never take life seriously. You won't get out alive anyway.
------------------------------------------------------------
Technical Details
Message-ID: <954795685.1431006335@localhost>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII-7-bit
X-Google-Thread: f4b73,7955a30db16a222f,start
X-Google-Attributes: gidf4b73,public
From: Joerg Hau <joerg.hau@swissonline.ch>
Subject: Problem mit grep-Umleitung in shellscript
Date: 2000/04/03
Message-ID: <954795685.1431006335@localhost>
X-Deja-AN: 606239218
Content-Transfer-Encoding: 8bit
Followup-To: ch.comp.os.linux
Content-Type: text/plain; charset="us-ascii"
X-Complaints-To: usenet@dplanet.ch
X-Trace: hs1b01h02-0.dplanet.ch 954795669 1760 212.35.55.227 (3 Apr 2000 21:01:09 GMT)
Organization: I speak for myself
Mime-Version: 1.0
NNTP-Posting-Date: 3 Apr 2000 21:01:09 GMT
Newsgroups: ch.comp.os.linux