Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Re: Copying Contents from the shell and write into the file

Expand Messages
  • mail meda
    Hi, If you want to write the contents of a shell file into other file Then make use of File handling mechanism Here is sample of using IO::File module use
    Message 1 of 4 , Jul 25, 2005
    • 0 Attachment
      Hi,

      If you want to write the contents of a shell file into other file
      Then make use of File handling mechanism

      Here is sample of using IO::File module

      use IO::File;

      my $filename = "/tmp/shell";
      my $filetowrite ="/tmp/copy_shell";

      my $fdesc = IO::File->new("<$filename") or die "Could not open the file
      $filename"; // Reading Shell
      my $fwrite = IO::File->new(">$filetowrite") or die "Could not open the file
      $filetowrite"; //Writing into a new file

      while(<$fdesc>)
      {
      my $line = $_;
      print $fwrite $line;
      }
      $fwrite->close;


      Regards,
      Shiva.
      On 7/25/05, qasumit <qasumit@...> wrote:
      >
      > Hi All,
      > Please provide me the solution of following problem...
      >
      > Thanks,
      > Sumit
      > --- In perl-beginner@yahoogroups.com, "qasumit" <qasumit@y...> wrote:
      > > Hi All,
      > > Can any one please provide me the PERL script for copying the
      > contents
      > > from the shell and write into the file.
      > >
      > > Thanks,
      > > Sumit
      > > --- In perl-beginner@yahoogroups.com, "qasumit" <qasumit@y...>
      > wrote:
      > > > Hi All,
      > > > Can any one please provide me the PERL script for copying the
      > > containts
      > > > from the shell and write into the file.
      > > >
      > > > Thanks,
      > > > Sumit
      >
      >
      >
      >
      >
      > Unsubscribing info is here:
      > http://help.yahoo.com/help/us/groups/groups-32.html
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.