- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: confirmation of fgrep or grep -f bug sought - ...
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
тАО08-20-2002 05:40 AM
тАО08-20-2002 05:40 AM
confirmation of fgrep or grep -f bug sought - diff OK
The HP patch database also reports an enormous number of patches associated to grep. What's up with this?
I assume this has been reported as a bug to HP but can one of you guys confirm? I'm using 11.00. Is there a patch remedy?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 05:50 AM
тАО08-20-2002 05:50 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
Can you post the command you were using to test this?
because I get the right results.
# cat hits_data2
Xbcdefg
hijklmn
# cat hits_data1
abcdefg
hijklmn
# cat hits_pat
abcdefg
# cat hits
#!/usr/bin/ksh
grep -f /tmp/hits_pat $1
echo $?
# ./hits /tmp/hits_data1
abcdefg
0
# ./hits /tmp/hits_data2
1
#
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 06:11 AM
тАО08-20-2002 06:11 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
Owner: SYSTEM
Name: Permissions:
-------------------------------------------------------------------------------
*Administrators FullControl(All)(All)
*CREATOR OWNER FullControl(All)(All)
*NUICORP\UBS-OAS Admin FullControl(All)(All)
*NUICORP\UBS-OAS Applications Change(RWXD)(RWXD)
*NUICORP\UBS-OAS Mapping Change(RWXD)(RWXD)
*NUICORP\UBS-OAS Programming Change(RWXD)(RWXD)
*SYSTEM SpecialAccess(All)*(NotSpecified)
The command completed successfully.
# cat 2
Owner: SYSTEM
Name: Permissions:
-------------------------------------------------------------------------------
*Administrators FullControl(All)
*NUICORP\UBS-OAS Admin FullControl(All)
*NUICORP\UBS-OAS Applications Change(RWXD)
*NUICORP\UBS-OAS Mapping Change(RWXD)
*NUICORP\UBS-OAS Programming Change(RWXD)
*SYSTEM FullControl(All)
The command completed successfully.
[nuiprd3]:/home/mfs/ACL_PERMS/Database # grep -f 1 1
# grep -f 1 1
Name: Permissions:
-------------------------------------------------------------------------------
*Administrators FullControl(All)(All)
*CREATOR OWNER FullControl(All)(All)
*NUICORP\UBS-OAS Admin FullControl(All)(All)
*NUICORP\UBS-OAS Applications Change(RWXD)(RWXD)
*NUICORP\UBS-OAS Mapping Change(RWXD)(RWXD)
*NUICORP\UBS-OAS Programming Change(RWXD)(RWXD)
*SYSTEM SpecialAccess(All)*(NotSpecified)
The command completed successfully.
# echo $?
0
# grep -f 1 2^M
Owner: SYSTEM
Name: Permissions:
-------------------------------------------------------------------------------
*Administrators FullControl(All)
*NUICORP\UBS-OAS Admin FullControl(All)
*NUICORP\UBS-OAS Applications Change(RWXD)
*NUICORP\UBS-OAS Mapping Change(RWXD)
*NUICORP\UBS-OAS Programming Change(RWXD)
*SYSTEM FullControl(All)
The command completed successfully.
echo $?^M
0
# fgrep 1 1^M
# echo $?^M
1
# fgrep 1 2^M
# echo $?
1
# diff 1 1^M
# echo $?^M
0
# diff 1 2^M
4,10c4,9
< *Administrators FullControl(All)(All)
< *CREATOR OWNER FullControl(All)(All)
< *NUICORP\UBS-OAS Admin FullControl(All)(All)
< *NUICORP\UBS-OAS Applications Change(RWXD)(RWXD)
< *NUICORP\UBS-OAS Mapping Change(RWXD)(RWXD)
< *NUICORP\UBS-OAS Programming Change(RWXD)(RWXD)
< *SYSTEM SpecialAccess(All)*(NotSpecified)
---
> *Administrators FullControl(All)
> *NUICORP\UBS-OAS Admin FullControl(All)
> *NUICORP\UBS-OAS Applications Change(RWXD)
> *NUICORP\UBS-OAS Mapping Change(RWXD)
> *NUICORP\UBS-OAS Programming Change(RWXD)
> *SYSTEM FullControl(All)
# echo $?^M
1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 08:35 AM
тАО08-20-2002 08:35 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
grep -f 1 2
will result in a 0
fgrep is obsolete, and you aren't using it right, because this:
fgrep 1 1
is comparing the string "1" to the File named "1", and because there are NO "1"'s in the File named "1", then the result is "1".
fgrep 1 2
Same here too, because there are NO 1's in the File named "2".
TRY this:
# fgrep OWNER 1
*CREATOR OWNER FullControl(All)(All)
# echo $?
0
# fgrep UGLYSTICK 1
# echo $?
1
#
Because there is the pattern "OWNER" in the File named "1", then this command is successful!
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 08:39 AM
тАО08-20-2002 08:39 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
fgrep has the format of
fgrep [-cefilnsvx] [strings] [file ...]
to use a FILE of STRINGS, then use:
fgrep -f FILEofPATTERNS FILE2SEARCH
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 08:54 AM
тАО08-20-2002 08:54 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
Not OK with grep -f which should produce the same result as fgrep -f.
Right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 08:57 AM
тАО08-20-2002 08:57 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
Wrong option, to get "grep" to act like "fgrep" use the "-F" option, not the "-f" option:
# grep -f OWNER 1
grep: can't open OWNER
# grep -F OWNER 1
*CREATOR OWNER FullControl(All)(All)
#
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 09:04 AM
тАО08-20-2002 09:04 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x022718276953d61190040090279cd0f9,00.html
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 09:22 AM
тАО08-20-2002 09:22 AM
Re: confirmation of fgrep or grep -f bug sought - diff OK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2002 09:24 AM
тАО08-20-2002 09:24 AM