- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: confusion about grep ?
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
Forums
Discussions
Discussions
Discussions
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
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
11-04-2004 11:04 PM
11-04-2004 11:04 PM
confusion about grep ?
# ls -d /proc/* | grep [0-9]
If I use the above grep command as root and from the /root directory ... the grep command is working as i would expect it to ( it return the list of all the /proc/'pid' of curently running processes )
But if I cd to an other directory I get no /proc/'pid' return ?
I dont get this !?
also if replace [0-9] with [1-0] I do get some /proc/'pid' return ... why ? any ideas !
J-P ( Who will gladly assign points to any light on this !)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2004 11:22 PM
11-04-2004 11:22 PM
Re: confusion about grep ?
Works fine on both machines from any directory.
Looks like you have a misconfigured enviroment.
You can always post an output from env command + The version of Linux you use.
P.S. Reboot might help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2004 11:28 PM
11-04-2004 11:28 PM
Re: confusion about grep ?
Keep it up I would gladly see you change hats ;-)
I run Fedora 2 on this setup and get the same result if I do this as root or as ordinary user
I will try this on an other system the I also configured for Fedora core 2
keep up the good work ;-)
J-P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2004 11:36 PM
11-04-2004 11:36 PM
Re: confusion about grep ?
I try on RedHat 8. No root user. Now the problem is when you have some directories with names 0,1,2... The workarround is:
ls -d /proc/* | grep "[0-9]"
Try: echo [0-9] to see what hapens.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2004 12:14 AM
11-05-2004 12:14 AM
Re: confusion about grep ?
I have done an output of env as root to a file and compare the output the only diferrence is one is on LANG=fr_BE,UTF-8 (this one is giving problem) the other is on LANG=en_US,UTF-8 (this one is working as expected)
Bojan, you are right, your string works but I did not have directory's with 0,1,etc..
I will later (+- one hour hopfully , have some meeting) create a dummy user using LANG=en_US on and see if this give better output.
But as often I thing Alexander is right ! hence the reason why he deserves a crown !
J-P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2004 12:16 AM
11-05-2004 12:16 AM
Re: confusion about grep ?
You and "the Steven" were the inspiration.
zero points please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2004 04:12 AM
11-05-2004 04:12 AM
Re: confusion about grep ?
this goes away when I change the LANG env to
#export LANG=en_US.UTF-8
I have also changed this in
/etc/sysconfig/i18n
Thank for your help.
Jean-Pierre
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2004 04:14 AM
11-05-2004 04:14 AM
Re: confusion about grep ?
J-P