Re: output from system call

2005-03-08 Thread geraldine_1
Thanks everyone for the input. Getting the date output is much easier in perl than I originally thought. thanks! Geraldine > On Tue, 8 Mar 2005, Ankur Gupta wrote: > > > [EMAIL PROTECTED] wrote: > > > > > Hi, > > > Is there a way to store the output of a system call on unix? > > > > > > e

Re: output from system call

2005-03-08 Thread Chris Devers
On Tue, 8 Mar 2005, Ankur Gupta wrote: > [EMAIL PROTECTED] wrote: > > > Hi, > > Is there a way to store the output of a system call on unix? > > > > eg. system("date"); > > > use backticks... > > $date = `date`; This is, of course, exactly the wrong way to solve this problem. Perl has date f

Re: output from system call

2005-03-08 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: Hi, Is there a way to store the output of a system call on unix? eg. system("date"); I like to store the date output to a variable. The only way I know of is to open and write the output to a file and then read in to a variable. Is there a simpler way? Thanks in advance.

RE: output from system call

2005-03-08 Thread Manav Mathur
chomp($date=`date`) ; ##exploiting what Perl offers but C doesnt -Original Message- From: Ankur Gupta [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 10:03 PM To: [EMAIL PROTECTED] Cc: beginners@perl.org Subject: Re: output from system call [EMAIL PROTECTED] wrote: >Hi,

Re: output from system call

2005-03-08 Thread mgoland
- Original Message - From: [EMAIL PROTECTED] Date: Tuesday, March 8, 2005 11:29 am Subject: output from system call > Hi, Hello, > Is there a way to store the output of a system call on unix? > sure > eg. system("date"); my $Date = system("date"); > > I like to store the date output

Re: output from system call

2005-03-08 Thread Ankur Gupta
[EMAIL PROTECTED] wrote: Hi, Is there a way to store the output of a system call on unix? eg. system("date"); use backticks... $date = `date`; Don't forget to chomp the $date variable as I guess you just want the date, not the newline character with it... chomp($date); -- To unsubscribe, e-mail: