Basically,

A portion of a script that I wrote, ftp's to a server grabs a particular
file that was created and pulls it down. Once down, I used the
system command to copy the file from one directory to another location.  The
problem with that is that I need to know what directory the script
is being run from, because ftp uses the local directory.  I attempted to
change the local directory with the ftp module, but that did not seem to
work for me.
Therefore, my goal was to find out what directory the script was running in,
and that way I would have my source directory for the copy.  This would
allow
the script to work properly regardless of what directory it was running in.
I could go back to the ftp module and try that again, but that will still
require the directory
to exist on each machine in order for it to work.  This will run on Win2K
machines.  So my ultimate goal is the former. To find what directory it is
in, and use that as it's
source directory.  That is exactly what I am trying to do.  Although I have
used system calls to copy files ,etc. I have been unable to use it in the
fashion that I need. Specifically,
to record each of the commands, the results for record keeping.
e.g.
$line = system ('cd foo');
print $line;

I hope this all makes sense.

Craig
[EMAIL PROTECTED]
Pager
Numeric: 1-877-895-3558
Email pager: [EMAIL PROTECTED]
--------------------------------------------------------------
You will never find time for anything.
If you want time, you must make it.

Charles Buxton

----- Original Message -----
From: "Paul" <[EMAIL PROTECTED]>
To: "Craig S Monroe" <[EMAIL PROTECTED]>
Cc: "Beginners@Perl (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, July 23, 2001 3:25 PM
Subject: Re: system interaction



--- Craig S Monroe <[EMAIL PROTECTED]> wrote:
> I also need to capture all commands, output to a logfile also.
> I have not been able to do this with system();

Why do you need system() at all?
Your Perl script can change directories &c., and you can dup STDERR and
STDOUT to filehandles if you need.
What are you doing? =o)

> Craig
> [EMAIL PROTECTED]
> Pager
> Numeric: 1-877-895-3558
> Email pager: [EMAIL PROTECTED]
> --------------------------------------------------------------
> You will never find time for anything.
> If you want time, you must make it.
>
> Charles Buxton
>
> ----- Original Message -----
> From: "Brett W. McCoy" <[EMAIL PROTECTED]>
> To: "Craig S Monroe" <[EMAIL PROTECTED]>
> Cc: "Beginners@Perl (E-mail)" <[EMAIL PROTECTED]>
> Sent: Monday, July 23, 2001 2:00 PM
> Subject: Re: system interaction
>
>
> On Mon, 23 Jul 2001, Craig S Monroe wrote:
>
> > I couldn't find anything relevant.
> > Are there any modules that deal with system interaction.
> > I need to navigate around a M$ machine and system commands only do
> so
> > much...
>
> Can you be more specific?  What kind of system interactions?
>
> -- Brett
>    http://www.chapelperilous.net/btfwk/
>
------------------------------------------------------------------------
> Q: What's the difference between Bell Labs and the Boy Scouts of
> America?
> A: The Boy Scouts have adult supervision.
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


=====
print "Just another Perl Hacker\n"; # edited for readability =o)
=============================================================
Real friends are those whom, when you inconvenience them, are bothered less
by it than you are. -- me. =o)
=============================================================
"There are trivial truths and there are great Truths.
 The opposite of a trival truth is obviously false.
 The opposite of a great Truth is also true."  -- Neils Bohr

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to