LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2008, 05:29 AM   #1
homyangcha
Member
 
Registered: Jun 2008
Posts: 31

Rep: Reputation: 15
i cannot run the command iptab


when i run the iptab command the following is the result:

# iptab <enter>
+----------------------------------------------+
| addrs bits pref class mask |
+----------------------------------------------+
Can't call method "is_zero" on an undefined value at /usr/lib/perl5/5.8.8/Math/BigInt.pm line 1148.


what is the problem can any throw light on this matter.
 
Old 09-12-2008, 08:03 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
How big is iptab. Its obviously a Perl prog. Can you post it here?
 
Old 09-12-2008, 02:04 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Code:
jschiwal@hpmedia:~> iptab
+----------------------------------------------+
| addrs   bits   pref   class  mask            |
+----------------------------------------------+
Can't call method "is_zero" on an undefined value at /usr/lib/perl5/5.10.0/Math/BigInt.pm line 1185.

 ls -l $(locate BigInt.pm)
-r--r--r-- 1 root root 149722 2008-07-15 09:43 /usr/lib/perl5/5.10.0/Math/BigInt.pm
jschiwal@hpmedia:~> ls -l $(locate --regex '/iptab$')
-r-xr-xr-x 1 root root 982 2008-06-06 16:29 /usr/bin/iptab
I tried the iptab command and it did the same thing. It looks like both BigInt.pm and iptab have been recently updated.
Code:
rpm -qi $(rpm -qf $(which iptab))
Name        : perl-Net-IP                  Relocations: (not relocatable)
Version     : 1.25                              Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Release     : 29.1                          Build Date: Fri 06 Jun 2008 04:29:24 PM CDT
Install Date: Sat 21 Jun 2008 03:57:44 PM CDT      Build Host: kimball.suse.de
Group       : Development/Libraries/Perl    Source RPM: perl-Net-IP-1.25-29.1.src.rpm
Size        : 81251                            License: Artistic License
Signature   : DSA/SHA1, Fri 06 Jun 2008 04:36:52 PM CDT, Key ID a84edae89c800aca
Packager    : http://bugs.opensuse.org
URL         : http://cpan.org/modules/by-module/Net/
Summary     : allow easy manipulation of IPv4 and IPv6 addresses
Description :
This is the Net::IP module, designed to allow easy manipulation of IPv4
and IPv6 addresses.
Code:
> cat $(which iptab)
#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

use Net::IP;
use strict;

print "+----------------------------------------------+
| addrs   bits   pref   class  mask            |
+----------------------------------------------+
";

my ($ip,$size,$class,$bits,$len);

my $ip = new Net::IP('0');

for my $len (reverse (0..32))
{

        $ip->set("0.0.0.0/$len");

        $size = $ip->size();

        if ($size >=1048576) # 1024*1024
        {
                $size /= 1048576;
                $size .= 'M';
        }
        elsif ($size >= 1024)
        {
                $size /= 1024;
                $size .= 'K';
        };

        $len = $ip->prefixlen();
        $bits = 32 - $len;

        if ($bits >= 24)
        {
                $class = 2**($bits-24);
                $class.= 'A';
        }
        elsif ($bits >= 16)
        {
                $class = 2**($bits-16);
                $class.= 'B';
        }
        elsif ($bits >= 8)
        {
                $class = 2**($bits-8);
                $class.= 'C';
        }

        printf ("| %5s %6s %6s %7s  %-15s |\n",
                $size,$bits,'/'.$len,$class,$ip->mask());


};

print "+----------------------------------------------+\n";

Last edited by jschiwal; 09-12-2008 at 02:17 PM.
 
Old 09-13-2008, 03:02 AM   #4
homyangcha
Member
 
Registered: Jun 2008
Posts: 31

Original Poster
Rep: Reputation: 15
i cannot run the command iptab

guys
sorry, i had to reload the OS again (CentOS 5.2). but this time i could not even run the command... this is the output...

# iptab
bash: iptab: command not found

Can you throw some light on this... i mean how to configure, install or setup so that iptab works correctly.

Thanks again
 
Old 09-13-2008, 06:12 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
On my system, the command is supplied by a "Perl-NET-IP" package. I think a perl package name may be standard across different Linux distributions.

Last edited by jschiwal; 09-13-2008 at 04:24 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell: command not found / Runs fine with "Run command" badbunny Linux - Newbie 1 01-22-2007 02:21 AM
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 06:29 PM
Cannot run CP command! hrudolph Linux - Newbie 12 05-14-2005 11:52 PM
How to run a command Maintech Mandriva 1 11-20-2004 10:41 PM
Run Command csosa Linux - Software 1 09-27-2003 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration