RE: output from system call

From: Manav Mathur (manavm_at_mahindrabt.com)
Date: 03/08/05


To: "Ankur Gupta" <Ankur.Gupta@synopsys.com>, <geraldine_1@comcast.net>
Date: Tue, 8 Mar 2005 22:05:30 +0530


chomp($date=`date`) ; ##exploiting what Perl offers but C doesnt

-----Original Message-----
From: Ankur Gupta [mailto:Ankur.Gupta@synopsys.com]
Sent: Tuesday, March 08, 2005 10:03 PM
To: geraldine_1@comcast.net
Cc: beginners@perl.org
Subject: Re: output from system call

geraldine_1@comcast.net 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: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>
*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s).   In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender.  The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be free of any virus.  However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use
*********************************************************


Relevant Pages

  • Re: tiresome ranting
    ... Why dont you bring up the quality ... God doesnt care about HLA. ... Security Guard told me: You cant shop ... I hear laughter inside the store. ...
    (alt.lang.asm)
  • Re: Script to ping
    ... I did this at my last job using perl to monitor and report on the ... store ping1 result ... store ping one fail result ... case ping1 is successful ...
    (microsoft.public.windows.server.scripting)
  • Re: Exch 2007 Mailbox role sending to IMCEAEX System Attendant?
    ... Ah Ok, no, not 6000 on 1 store. ... "John Fullbright" wrote: ... then I think we can live with the invalid emails. ... doesnt exist as an email address on my system. ...
    (microsoft.public.exchange.connectivity)
  • UTF-8 issues connecting to Oracle
    ... A Google search turned up a known problem with perl on ES 3 and the UTF8 character set. ... <- STORE= 1 at Oracle.pm line 61 ... 'select collection_name from clone_collection' undef) thr#504010 ... <- DESTROY= undef ...
    (perl.dbi.users)
  • Re: Configure fails (./myread no such file or directory)
    ... Ive ended up modifying Configure.sh so that it doesnt call ./myread ... > Build a threading Perl? ... > Let me guess what the preprocessor flags are... ... > Checking your choice of C compiler and flags for coherency... ...
    (comp.lang.perl.misc)