473,396 Members | 2,030 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,396 software developers and data experts.

code differences

kaarthikeyapreyan
I am interested to know why the ip are not listed with the -w option in grep
It works fine on my ubuntu 8.04 version(bash) but not in my HP-UX Release 11i (ksh)

Expand|Select|Wrap|Line Numbers
  1. mysys:/tmp/x->find . -type f -print | xargs grep -n -w '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
  2. mysys:/tmp/x->find . -type f -print | xargs grep -n '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'
  3. ./test/myfile.txt:2:this line contains ip 192.162.110.2
  4. ./test/myfile.txt:3:mutliple ip on single line 193.254.110.23 ans with the 10.10.10.1
  5. ./test/testfile2.txt:2:192.23.345.45
  6. ./test/testfile2.txt:3:includes ip configured to match teh currenmt 10.11.101.23
Oct 27 '09 #1
8 1660
micmast
144 100+
what version of grub is on both machines?
Oct 27 '09 #2
gits
5,390 Expert Mod 4TB
do you mean grep? just wondering ... :) .... to get the version of grep you might use:

Expand|Select|Wrap|Line Numbers
  1. grep -V
gives you something like:

Expand|Select|Wrap|Line Numbers
  1. GNU grep 2.5.4
  2.  
  3. Copyright (C) 2009 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.
  7.  
kind regards
Oct 28 '09 #3
There was no version information attached to the grep.
but the STANDARDS CONFORMANCE
grep: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2

Expand|Select|Wrap|Line Numbers
  1. hp:/preyan->grep -V
  2. grep: illegal option -- V
  3. usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] -e pattern_list...
  4.         [-f pattern_file...] [file...]
  5. usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] [-e pattern_list...]
  6.         -f pattern_file... [file...]
  7. usage: grep [-E|-F] [-c|-l|-q] [-bhinsvx] pattern [file...]
the grep command works as desired in my linux box with the bash shell
but i am interested to know why this is not the same in the HP-UX Release 11i
though it is complaint ot the standard.
Oct 28 '09 #4
@micmast
Just got curious on this reply, how does grub play a role in this issue ?
or was that a typo
Oct 28 '09 #5
gits
5,390 Expert Mod 4TB
perhaps:

Expand|Select|Wrap|Line Numbers
  1. grep --version
works to get the verision info? i suspect the -w option could be the problem - just a guess based on the last output you posted?

kind regards
Oct 28 '09 #6
micmast
144 100+
@kaarthikeyapreyan
it doesn't, it should be grep :)
my typing is worse then your average joe, sorry for that :)
Oct 28 '09 #7
@gits
Yes it is the problem and --version is also an illegal option
-w does not work as expected in this grep.
this does not integrate any version information.
Oct 28 '09 #8
gits
5,390 Expert Mod 4TB
ok ... since it just seems to be clear that it works differently on both of the machines i would suggest to just avoid the -w option and use a regExp instead ... or have a look here at a similar question at the HP resource center

kind regards
Oct 28 '09 #9

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

Similar topics

6
by: Martin Meyer im Hagen | last post by:
Hello, I've got installed Win 2003 SBS Premium with the SQL Server 2000 on a server machine. It works almost fine, except the application which uses the SQL Server. The main part of the...
2
by: Daniel | last post by:
Hi, Are there any differences between C# and VB.Net besides syntax? Performance-wise, how do they compare? Thanks, Dan
14
by: Bern | last post by:
what are all the diferences between the two?
4
by: effendi | last post by:
How can I extract differences between two arrays using Javascript? I hv for example, apple, orange, pear and another array with apple, orange and I would like to get pear. Thanks.
13
by: Kieran | last post by:
I am designing a content management system and I want to make sure all pages entered into it's database by users are using valid HTML. I have designed the system to use HTML 4.01 Transitional...
4
by: MS | last post by:
Just a general question here re VBA. Can anyone explain the differences between "!" and "." when refering to a control? eg Me!TxtBox and Me.TxtBox. What is difference between "+" and "&"...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
82
by: Edward Elliott | last post by:
This is just anecdotal, but I still find it interesting. Take it for what it's worth. I'm interested in hearing others' perspectives, just please don't turn this into a pissing contest. I'm in...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
3
by: pradeep | last post by:
Hello, Can any one tell me different functions or properties of javascript which are gives different outputs on different browsers ? Thanks in advance. Bye
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.