check whether cpan is installed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pavanponnapalli
    New Member
    • May 2008
    • 51

    check whether cpan is installed

    hi ,
    I have got a shell script as under:

    doct.sh

    in that i have the following code
    Code:
           cpan install DBI
           cpan install DBD::mysql
           .........
    before installing DBI i need to know whether perl,cpan and ppm is existing in the linux machine or not. can anybody tell me the shell script for that as i am new to shell script.
    Thanks
    pavan
    Last edited by Nepomuk; Sep 19 '08, 07:45 AM. Reason: The [code] tags end with [/code], not with [%code]
  • micmast
    New Member
    • Mar 2008
    • 144

    #2
    it depends on your linux distributions, most of them have excellent package managers that will allow you to do a lookup. Another options is to make the program print a version number. Or you can use a command like which, this will tell you the location of a program.

    What system are you using? Or is it for any system?

    Comment

    • pavanponnapalli
      New Member
      • May 2008
      • 51

      #3
      Originally posted by micmast
      it depends on your linux distributions, most of them have excellent package managers that will allow you to do a lookup. Another options is to make the program print a version number. Or you can use a command like which, this will tell you the location of a program.

      What system are you using? Or is it for any system?
      hi,
      it is for ubuntu and solaris os. please can to tell me how to write a shell code whether perl,cpan and ppm exists before the script installs the modules from cpan
      regards,
      pavan

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by pavanponnapalli
        hi,
        it is for ubuntu and solaris os. please can to tell me how to write a shell code whether perl,cpan and ppm exists before the script installs the modules from cpan
        regards,
        pavan
        Perl is pretty much installed by default on most Unix systems these days. If it isn't, I would be surprised.

        The cpan command is part of the default Perl distribution as well. But, if you haven't used it with the particular user before, you will have to go through its setup before writing a script around it.

        As for ppm, I would avoid its use as it is buggy in other than the Active State Perl distribution, which is for WIndows, and even then, I don't recommend it myself.

        Regards,

        Jeff

        Comment

        Working...