473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

check whether cpan is installed

hi ,
I have got a shell script as under:

doct.sh

in that i have the following code
Expand|Select|Wrap|Line Numbers
  1.        cpan install DBI
  2.        cpan install DBD::mysql
  3.        .........
  4.  
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
Sep 19 '08 #1
3 2652
micmast
144 100+
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?
Sep 19 '08 #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?
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
Sep 19 '08 #3
numberwhun
3,509 Expert Mod 2GB
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
Sep 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: p cooper | last post by:
router root # perl -MCPAN -e 'install Net::SMTP' CPAN: Storable loaded ok LWP not available CPAN: Net::FTP loaded ok Fetching with Net::FTP: ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz...
1
by: Praveen | last post by:
Hi All, I'm new to DB2, I have installed DB2 UDB V8 on Solaris machine. And i tried to create a stored proc.But, gives the following error.. -- LOG FILE P2093405.log FOR PROCEDURE...
1
by: Bijoy Thulasidharan | last post by:
Hi , Hope you should be able to help us out with the below issue Before subscribing to a delegate like this cell.OnGridCellSelected += new System.EventHandler(_OnGridCellSelected); we...
1
by: James Tsao | last post by:
is it possible to see whether or not a program is installed on a machine? for example, i'd like to check if winzip is installed and if it is installed, the location of the executable. thanks. ...
5
by: zimmy | last post by:
Hi, Is it possible to check whether ASP.NET is installed on a machine, within a program that I'm writing in C#? And if it's installed, can I check if it is enabled? How? Thanks
1
by: keri | last post by:
Hi, I use the below for the user to view their outlook calendar Sub DisplayInbox() Dim myolApp As Outlook.Application Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.MAPIFolder...
1
numberwhun
by: numberwhun | last post by:
Ok, I have an issue and I am not sure what is causing it. I am working on a Fedora Core 7 Linux machine (my laptop). I have not had any problems with installing modules via CPAN. All has...
1
by: sowm18 | last post by:
Hi all, I am trying to install IO::Tty module from CPAN on my Windows Machine which has Active Perl 5.8.8 Version running. During the module installation, I get the compilation error. ...
3
by: vijayarl | last post by:
Hi everyone, Requirement: Am trying to install the CPAN module : Spreadsheet::Excelsheet through PPM i have downloaded the Spreadsheet-ParseExcel-0.33.tar.gz file & uncompress it Problem: ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.