Re: How can I assign system() call to a Variable

2007-11-15 Thread Jeff Pang
On Nov 14, 2007 11:11 AM, Marco <[EMAIL PROTECTED]> wrote: > > $inact = "cat /proc/meminfo | grep -w Inactive | sed 's/^.*Inactive: // > g' | sed 's/kB//'"; > $result = system(cat /proc/meminfo | grep -w Inactive | sed 's/ > ^.*Inactive: //g' | sed 's/kB//'); > print $result; > > btw, here you re

Re: How can I assign system() call to a Variable

2007-11-15 Thread Jeff Pang
On Nov 15, 2007 3:05 PM, Marco <[EMAIL PROTECTED]> wrote: > > > By the way, how can I use this script to get the data I need form > remote machine?...thanks > > use Net::SSH or something like that. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ht

Re: How can I assign system() call to a Variable

2007-11-15 Thread Marco
By the way, how can I use this script to get the data I need form remote machine?...thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How can I assign system() call to a Variable

2007-11-14 Thread Marco
Hi.. Thanks for all you guys help & Suggestion. Actually I truned around to use the other way to get the data I need since system() give me such a hard time... :( my $inactive = "cat /proc/meminfo | grep -w Inactive | sed 's/ ^.*Inactive://g' | sed 's/kB//'"; open(DATA, "$inactive|") || die "Ca

Re: How can I assign system() call to a Variable

2007-11-14 Thread Marco
Hi... Relly appreciate all of you guys' help. You guys did provide me valuable information. I will give it a try all you guys suggestion. Actually I gave up the system() call last night since it gave me such a hard time. The other way I did is shown below to get the data I need, my $inactiv

Re: How can I assign system() call to a Variable

2007-11-14 Thread yaron
:21 AM (GMT+0200) Asia/Jerusalem Subject: Re: How can I assign system() call to a Variable On Nov 14, 2007 5:18 PM, Beginner <[EMAIL PROTECTED]> wrote: > On 13 Nov 2007 at 19:11, Marco wrote: > > my $result = system($inact); > print $result; > my $result = `system commands`; print

Re: How can I assign system() call to a Variable

2007-11-14 Thread Ron Bergin
On Nov 13, 7:11 pm, [EMAIL PROTECTED] (Marco) wrote: > Hi... > > Can someone help me on this? Actually I can get the dara from the > system()...But it shows "0" when I print the $result...How can I > assign the system() to $result ?Thanks... > > here below is the code... > > $inact = "cat /proc

Re: How can I assign system() call to a Variable

2007-11-14 Thread Ron Bergin
On Nov 13, 7:11 pm, [EMAIL PROTECTED] (Marco) wrote: > Hi... > > Can someone help me on this? Actually I can get the dara from the > system()...But it shows "0" when I print the $result...How can I > assign the system() to $result ?Thanks... > > here below is the code... > > $inact = "cat /proc

Re: How can I assign system() call to a Variable

2007-11-14 Thread Jeff Pang
On Nov 14, 2007 5:18 PM, Beginner <[EMAIL PROTECTED]> wrote: > On 13 Nov 2007 at 19:11, Marco wrote: > > my $result = system($inact); > print $result; > my $result = `system commands`; print $result; system() returns nothing but the executed status of the command itself. -- To unsubscribe, e-

Re: How can I assign system() call to a Variable

2007-11-14 Thread Beginner
On 13 Nov 2007 at 19:11, Marco wrote: > Hi... Hi > Can someone help me on this? Actually I can get the dara from the > system()...But it shows "0" when I print the $result...How can I > assign the system() to $result ?Thanks... > > here below is the code... > > $inact = "cat /proc/meminfo

How can I assign system() call to a Variable

2007-11-14 Thread Marco
Hi... Can someone help me on this? Actually I can get the dara from the system()...But it shows "0" when I print the $result...How can I assign the system() to $result ?Thanks... here below is the code... $inact = "cat /proc/meminfo | grep -w Inactive | sed 's/^.*Inactive: // g' | sed 's/kB