- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Grep for strings in all caps?
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
тАО09-03-2009 05:18 AM
тАО09-03-2009 05:18 AM
I have a file like this:
/directory/path/AAA/file.txt
/directory/path/bbb/file.txt
/directory/path/CCC/file.txt
I want to grep the file for anything in all caps. So that I would only get the output for AAA and CCC but not bbb because there are no caps. Is this possible?
Solved! Go to Solution.
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2009 05:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2009 05:26 AM
тАО09-03-2009 05:26 AM
Re: Grep for strings in all caps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2009 06:41 AM
тАО09-03-2009 06:41 AM
Re: Grep for strings in all caps?
"All caps" and "any caps" are not the same
thing. "AaA" is not "all caps". Different
regular expressions can distinguish among
the many possibilities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2009 08:33 AM
тАО09-03-2009 08:33 AM
Re: Grep for strings in all caps?
/directory/path/bbb/file.txt
/directory/path/CCC/file.txt
I want to grep the file for anything in all caps. So that I would only get the output for AAA and CCC but not bbb because there are no caps. Is this possible? "
of course, none of the above qualify as "all caps", grepping for [:upper:] will find any caps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2009 04:53 PM
тАО09-03-2009 04:53 PM
Re: Grep for strings in all caps?
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-03-2009 07:50 PM
тАО09-03-2009 07:50 PM
Re: Grep for strings in all caps?
> specialized.
I'd say that was not clearly specified.
> You want to [...]
I can only marvel at the psychic abilities
of anyone who knows what the original poster
wants. (Except, perhaps, the OP himself.)
Given the vagueness and/or ambiguity and/or
incompleteness of the problem statement, I'd
prefer to wait for something better before
claiming to have The Solution.
> The problem is that you'll need to create
> a regular expression that matches a
> variable number of UPPERCASE letters.
That may be _a_ problem, but something so
simple as
/[A-Z]*/
might do the job. Not knowing what the job
actually is makes it hard to say.
> Perfect. [...]
But, hey. If he's happy, who am I to argue?