HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Script is not running

 
SOLVED
Go to solution
HP UNIX Professionals
Frequent Advisor

Script is not running


Hi Experts,

When i try to run the script to gather the information releated to SG. I am getting error such as

XXXXX:/tmp # ./SGinfo
interpreter "/sbin/sh" not found
sh: ./SGinfo: not found.

Please help me to sort-out the issue.

Thanks in Advance

vinay

Eroor Message:
===============
blxc30:/tmp # ./SGinfo
interpreter "/sbin/sh" not found
sh: ./SGinfo: not found.
6 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: Script is not running

Hi:

I suspect that you have carriage-returns in your script from editing (or copying) it from a Windows platform. The presence of carriage-returns on the interpreter ("shebang") line will generate this error. To see, look for "^M" as by doing:

# cat -etv ./SGinfo

Regards!

...JRF...
Bill Hassell
Honored Contributor
Solution

Re: Script is not running

This is probably due to transferring this script using binary from a PC. Edit the file with vi and you'll probably see the PC end-of-line character ^M (aka, carriage return) after every line. You can either transfer the file again with ftp using the ASCII translation feature, or on HP-UX, use dos2ux to filter the file:

$ dos2ux SGinfo > SGinfo.ok


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: Script is not running

Hi (again):

I should add (since you probably have carriage-returns) that you can fix your script by doing:

# dos2ux < ./SGinfo > ./SGinfo.new

Regards!

...JRF...
HP UNIX Professionals
Frequent Advisor

Re: Script is not running

Hi James,

I removed all carriage returns as per you advice, but i am getting the error Now such as.
Please help me.

Error:
======
XXXXX:/tmp # ./SGinfo
Script is corrupt. The calculated and posted checksums do not match:
Calculated: 3112900085 Posted: 4000628928
To ignore script integrity checking, run script with -i option.
Bill Hassell
Honored Contributor

Re: Script is not running

I would go back to the originator of the script and ask the questions. Apparently it has self-checking code and it doesn't match the original.


Bill Hassell, sysadmin
Patrick Wallek
Honored Contributor

Re: Script is not running

Note the last line of the message:

>>To ignore script integrity checking, run script with -i option.

So you could try running it like this:

# ./SGinfo -i