Operating System - HP-UX
1848632 Members
3371 Online
104033 Solutions
New Discussion

unshar patches -environmental problem

 
SOLVED
Go to solution
Randy Tarrier
Advisor

unshar patches -environmental problem

I'm getting an environmental error while attempting to unshar patches:
# sh PHKL_24027
PHKL_24027[15]: ^M: not found.
PHKL_24027[16]: LANG^M: This is not an identifier.
These are the permissions on the file:
# ll PHKL_24027
-rwxrwxrwx 1 root sys 468069 Oct 26 10:59 PHKL_24027
This is my environment:
# env
_=/usr/bin/env
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/u
sr/local/man/%L:/usr/local/man:/opt/pd/share/man/%L:/opt/pd/share/man:/opt/ignit
e/share/man/%L:/opt/ignite/share/man:/opt/fcms/bin:/opt/perf/man/%L:/opt/perf/ma
n:/share/man:/opt/omni/lib/man:/opt/hparray/share/man/%L:/opt/hparray/share/man:
/opt/upgrade/share/man/%L:/opt/upgrade/share/man:/usr/dt/share/man:/opt/pd/share
/man/%L:/opt/pd/share/man:/opt/resmon/share/man:/opt/pred/share/man/%L:/opt/pred
/share/man
LANG=
PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/nettladm/bin:/opt/pd/
bin:/opt/upgrade/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/fcms/bin:/opt/perf/b
in:/bin:/opt/omni/bin:/opt/ignite/bin:/opt/hparray/bin:/opt/fc/bin:/opt/resmon/b
in:/opt/pred/bin:/sbin:/home/root
EDITOR=vi
LOGNAME=root
MAIL=/var/mail/root
ERASE=^H
SHELL=/sbin/sh
HOME=/
TERM=ansi
PWD=/tmp
TZ=EST5EDT
#
These are the first 20 lines of the patch file:

#---------------------------------- cut here ----------------------------------
# This is a shell archive. Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by WTEC Patch Team on Mon Oct 22 15:27:22 2001
#
# This archive contains:
# PHKL_25475.text PHKL_25475.depot
#
# Existing files will not be overwritten.
# Modification/access file times will be preserved.
# Error checking via wc(1) will be performed.
# Error checking via sum(1) will be performed.
# Binary files are compressed using compress(1).

LANG=""; export LANG
LC_CTYPE=""; export LC_CTYPE
LC_ALL=""; export LC_ALL
PATH=/bin:/usr/bin:$PATH; export PATH

if sum -r
/dev/null 2>&1
then
sumopt='-r'
else
sumopt=''
fi

It's probably something elementary, but I'm not sure what...???????????
Do it as long as you love it!
5 REPLIES 5
Darrell Allen
Honored Contributor

Re: unshar patches -environmental problem

Just a guess - try dos2ux on the file then unshar it.
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
S.K. Chan
Honored Contributor

Re: unshar patches -environmental problem

a) Did you download the patch to a PC ?
b) ^M is probably from the pc "end-of-line".

If a) is true .. do this to remove the line feed.

# dos2ux thesharfile > cleansharfile
# sh cleansharfile


Bill McNAMARA_1
Honored Contributor

Re: unshar patches -environmental problem

dos2ux to remove window ctrl files..

Later,
Bill
It works for me (tm)
David Lodge
Trusted Contributor
Solution

Re: unshar patches -environmental problem

Number one cause of this is due to an ftp from a DOS/windows machine to a Unix machine done in binary mode.

For some obscure reason most PC operating systems use a CRLF combination to mean end of line, whereas HP-UX uses LF.

The quickest way of removing extraneous CR's is to use:
tr -d '^M' temp

(Note the ^M is achieved by pressing CTRL-V, CTRL-M )

I have had problems in getting dos2ux working in the past.

To avoid this in future always transfer in ASCII when transferring shar files from DOS -> Unix

dav
Uday_S_Ankolekar
Honored Contributor

Re: unshar patches -environmental problem

Hi,

1.While doing ftp use ASCII in future..
2. Secondly use do2ux command to replace ^M

-USA..
Good Luck..