- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find hint
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
07-13-2006 10:45 PM
07-13-2006 10:45 PM
find hint
Inside a script I am trying to find files using variables, then the command construction seems fine but not run. I have even tried to escape the -exec parsed {} but nothing. Where I am failing?
FILENAME="trartiaur*.txt"
EXPIRATION=60
COMMAND="/usr/contrib/bin/gzip -9"
find . -type f -name $FILENAME -mtime +$EXPIRATION -exec $COMMAND {} \;
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 10:49 PM
07-13-2006 10:49 PM
Re: find hint
What happens if you run the find command from the command line?
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 10:57 PM
07-13-2006 10:57 PM
Re: find hint
No error message is displayed, even the $? value is zero.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 10:57 PM
07-13-2006 10:57 PM
Re: find hint
have you tried:
find . -type f -name "${FILENAME}" -mtime +${EXPIRATION} -exec ${COMMAND} {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 10:59 PM
07-13-2006 10:59 PM
Re: find hint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 11:01 PM
07-13-2006 11:01 PM
Re: find hint
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 11:03 PM
07-13-2006 11:03 PM
Re: find hint
on my machine:
#!/usr/bin/sh
FILENAME="*.txt"
EXPIRATION=2
COMMAND="ls -l"
find . -type f -name "${FILENAME}" -mtime +${EXPIRATION} -exec $COMMAND {} \;
$ ./a.sh
-rw-r----- 1 godronpw users 695 May 11 12:29 ./perl.txt
-rw-rw-rw- 1 godronpw users 670 May 11 12:30 ./perl2.txt
Otherwise I can only advise to slowly build up your find i.e. start with find . -name "${FILENAME}" then add the other bits one by one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 11:23 PM
07-13-2006 11:23 PM
Re: find hint
I get it! An extra (unwished) double quotation marks character included into FILENAME variable was the pain!
In any case, thank you very much and points for everybody!
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 11:25 PM
07-13-2006 11:25 PM