- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Any syntax errors in this command?
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
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
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
05-17-2002 09:05 AM
05-17-2002 09:05 AM
find . -type f -user $USER -mtime +90 | grep -v '^.sh$' | grep -v '^.pl$' | gre
p -v '^.sql$' >> $LOGFILE.$USER.log
However, I am not obtaining the expected result, which should exclude all files with the following pattern *.sh* *.pl* and *.sql*. Why? Where did I go wrong? Any hints?
Thanks...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:15 AM
05-17-2002 09:15 AM
Re: Any syntax errors in this command?
Use "set -x" before executing the command and verify how it is resolving your pattern matching.
I would think of taking out single quotes and replacing ^ and $ with the wild char *.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:24 AM
05-17-2002 09:24 AM
Re: Any syntax errors in this command?
grep -v *\.sh*
.. for example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:25 AM
05-17-2002 09:25 AM
Re: Any syntax errors in this command?
find . -type f -user $USER -mtime +90 | grep -v '.sh$' | grep -v '.pl$' | grep -v '.sql$' >> $LOGFILE.$USER.log
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:30 AM
05-17-2002 09:30 AM
Re: Any syntax errors in this command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:35 AM
05-17-2002 09:35 AM
Re: Any syntax errors in this command?
Try this,
find . -type f -user $USER -mtime +90 | grep -v '\.sh$' | grep -v '\.pl$' | grep -v '\.sql$' >> $LOGFILE.$USER.log
Hope this helps.
regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:36 AM
05-17-2002 09:36 AM
Re: Any syntax errors in this command?
grep -v -e \.sh -e \.pl -e \.sql
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:42 AM
05-17-2002 09:42 AM
Re: Any syntax errors in this command?
find ... | grep -v -E "\.[sql|pl|sh]([._][0-9]*)*$" >logfile
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:48 AM
05-17-2002 09:48 AM
Re: Any syntax errors in this command?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 09:54 AM
05-17-2002 09:54 AM
Re: Any syntax errors in this command?
Your original expression meant to match the patterns as achored at both the beginning and the ending of a line -- i.e. strings that constitute the whole line. Returning filenames from the current directory would yield strings beginning with "./" too.
Regards!
...JRF...