there is another way to do this
$output=`ifconfig -options`;# execute ifconfig with options and save output
in $output
open (FH ,"> yourfilehere.txt");# open your textfile for writing
print FH $output;# print everything ifconfig has printed to the file
close FH;
#ifconfigs output is still available in the variable $output so you don't
have to open the textfile again
or you could do
system ("ifconfig -options > textfile.txt"); #let the shell do the writing
of the textfile
open (FH, "< textfile.txt");# and open the textfile for reading
hope this helps you
greetz
Remco Schoeman
-----Original Message-----
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: donderdag 4 oktober 2001 04.40
To: [EMAIL PROTECTED]
Subject: Piping ifconfig to a text file
> List,
>
> Can some one help me with opening ifconfig and pipe it to a text file.
> Then I want to be able to view that file.
>
> How would I go about this?
>
> open IFCONFIG, "/sbin/ifconfig";
> $file=<IFCONFIG>;
> print $file;
>
> ....
>
> Kind regards,
>
> Daniel Falkenberg
>
> ==============================
> VINTEK CONSULTING PTY LTD
> (ACN 088 825 209)
> Email: [EMAIL PROTECTED]
> WWW: http://www.vintek.net
> Tel: (08) 8523 5035
> Fax: (08) 8523 2104
> Snail: P.O. Box 312
> Gawler SA 5118
> ==============================
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]