- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Grep acting different between HPUX 10.20 and HPUX ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 08:07 AM
тАО12-01-2003 08:07 AM
########### HPUX 10.20 ##############
dev1:/tmp>cat me5
helloappdev1:/tmp>
dev1:/tmp>grep lo me5
helloappdev1:/tmp>
############### HPUX 11.i ############
dev2:/tmp>cat me5
hellodv1csite:/tmp>
dev2:/tmp>grep lo me5
hello
dv1csite:/tmp>
I was wondering if anyone knows how to make the grep functionality act consistant (does matter which way the output looks as long as 10.20 and 11.i are consistant). Like I said they will not let me modify the input file before the grep. I also suggested using a Perl one liner "perl -ne 'print if /
Please advise, if you have any suggestions for regular expersion for the grep command or ways to remove any/all DOS (or other) formating charaters from a line. Or if you have similair problem and your solution (patch etc...)
P.S. If you want to try this on your systems create a text file on Windows/DOS with notepad and FTP to 10.20 and 11.i servers. Do not have a return at the end of the last line.
Thanks!!!!!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 08:12 AM
тАО12-01-2003 08:12 AM
Re: Grep acting different between HPUX 10.20 and HPUX 11.11
I'd check for patches, both 10.20 and 11.11 and see if there is anything for grep
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 08:12 AM
тАО12-01-2003 08:12 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 08:14 AM
тАО12-01-2003 08:14 AM
Re: Grep acting different between HPUX 10.20 and HPUX 11.11
Have you tried using the 'dos2ux' command on the file? Even if they won't let you modify it maybe you could use it to create a temporary file to use for your grep?
Just an idea.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 09:05 AM
тАО12-01-2003 09:05 AM
Re: Grep acting different between HPUX 10.20 and HPUX 11.11
A PC-based text file is:
text CR LF
more text CR LF
last line CR LF
CTRL-Z
but Unix text files are:
text LF
more text LF
last line LF
NUL
So the first question is: how did the file get from a PC to Unix? By ftp (then use the ASCII option when transferring), or by filesystem sharing as in SAMBA? If the latter, you will *always* have formatting issues because the two systems (PC and Unix) use different tools for the creation of the files and representation of the data. There is no reason to expect them to be compatible at all. However, HP-UX recognized this problem a long time ago, and provides bi-directional converter tools (dos2ux and ux2dos) to handle the differences.
As for the inconsistent behavior, this is a typical corner case that is undefined between versions of grep and there is no special option to add a newline if the last line contains CTRL-Z and no CR+LF pair. So you'll have to translate the file before using grep (which is sort of a special option):
dos2ux pc_file_name | grep
Most likely this will standardize the file format and should produce the same result on both HP-UX systems.
If not, grep was never designed as a formatting tool and a regular expression does not perform formatting, it is used only for pattern matching. With enough perl or awk code, you could probably make it work but the real issue is expecting internal data formats to be the same with foreign systems. That's why there is an ASCII option in ftp.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 09:08 AM
тАО12-01-2003 09:08 AM
Re: Grep acting different between HPUX 10.20 and HPUX 11.11
# od -x me5
And are the versions of grep comparable? iow, are you using HP's version of grep on both sides, or is either version GNU grep, behaving differently
# grep -V
GNU grep will return the version, HP's grep will return a usage message
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-01-2003 09:15 AM
тАО12-01-2003 09:15 AM
Re: Grep acting different between HPUX 10.20 and HPUX 11.11
I was able to copy a 10.20 grep binary and put it it /usr/bin/ as 1020grep and then put in alias in the users profile for grep to ran 1020grep (as this is what they wanted). Thanks for all your help/suggestions!!!!!