Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 709919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:33:26+00:00 2026-05-14T04:33:26+00:00

I am trying to check if md5sum or digest exists on solaris and script

  • 0

I am trying to check if md5sum or digest exists on solaris and script is used on different machines.

Here is the function in sh script which is called from a ksh script

getMD5cmd ()
{
    PATH="${PATH}:/bin:/usr/bin:/usr/sfw/bin:/usr/local/bin:/usr/sbin/bin"
    if type -p md5sum;then
        MD5CMD=`type -p md5sum`
    elif type -p digest;then
        MD5CMD="`type -p digest` -a md5"
    fi
    echo "HERE ${MD5CMD}"
}

When I run scripts I get

-p not found
md5sum not found
-p not found
digest is /bin/digest
HERE

However, when I type it in a terminal, works as exptected

Any Ideas?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:33:26+00:00Added an answer on May 14, 2026 at 4:33 am

    You are likely running ksh or possibly Bash for your interactive shell. Both of these have a -p option for type. The shell (probably sh) that your script is running in has type but doesn’t have the -p option so it’s looking for “-p” as the name of an executable and it doesn’t find it.

    So you could change your script to use ksh or you could use the which program. The latter is probably more portable, since some systems don’t have ksh.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to check out SLF4J-Simple from GitHub which shows the actual source
I trying to check if an URL which I want to connect to exists
I am trying to check if the 'Listivew.Tag property is nothing'. I used to
I'm trying to check if a gravatar exists. When I try the approach recommended
I'm trying to check if a service exists on a remote machine using the
I was trying to check out a project from SVN using Eclipse. I tried
Trying to create a script to read a remote file and check the md5
Trying to check if a name is already stored in the database from the
Im trying to check if a directory exists on an FTP server. Before you
I am trying to check if a value from database table is equal to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.