- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find -exec terminated by "+"
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
02-27-2003 06:51 AM
02-27-2003 06:51 AM
find -exec terminated by "+"
#uname -a
HP-UX moriston B.11.11 U 9000/800 639309331 unlimited-user license
#find . -name \*sql -exec grep -il gl_data {} \;
./11325/chg_mine.sql
./11325/code/sp_hkeep_gl_data.sql
./11325/code_11325.sql
#find . -name \*sql -exec grep -il gl_data {} \+
--Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 06:52 AM
02-27-2003 06:52 AM
Re: find -exec terminated by "+"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 08:05 AM
02-27-2003 08:05 AM
Re: find -exec terminated by "+"
Which manual was this in? I've never seen this syntax before.
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 08:10 AM
02-27-2003 08:10 AM
Re: find -exec terminated by "+"
-exec cmd True if the executed cmd returns a zero value
as exit status. The end of cmd must be
punctuated by a semicolon (;) or a plus sign
(+) (semicolon and plus are special to the
shell and must be escaped). When a plus sign
is used, cmd aggregates a set of pathnames
and executes on the set. The reason for
preferring + to a semicolon is vastly
improved performance. Any command argument
{} is replaced by the current path name. cmd
may contain supplementary code set
characters.
I've tried this myself and never even gotten a prompt back - had to
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 08:12 AM
02-27-2003 08:12 AM
Re: find -exec terminated by "+"
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 09:50 AM
02-27-2003 09:50 AM
Re: find -exec terminated by "+"
find /tmp -name ian\* -exec ls -d {} \+
/tmp/ian1:
ian11
/tmp/ian1/ian11:
/tmp/ian2:
ian12
/tmp/ian2/ian12:
find /tmp -name ian\* -exec ls {} \+
returns nothing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 10:34 AM
02-27-2003 10:34 AM
Re: find -exec terminated by "+"
Can you humour me and try running your command as follows:
#find . -name \*sql -exec grep -il gl_data gl_data {} \+
ie, adding an extra gl_data and letting me know if it works.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 11:05 AM
02-27-2003 11:05 AM
Re: find -exec terminated by "+"
That seems to work (but is counter-intuitive, to say the least).
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2003 12:12 PM
02-27-2003 12:12 PM
Re: find -exec terminated by "+"
Look at the following:
# find /tmp -name 'aa*' -exec ls {} \+
# find /tmp -name 'aa*' -exec ls \+
/tmp/aaa
# find /tmp -name 'aa*' -exec ls {} \;
/tmp/aaa
# find /tmp -name 'aa*' -exec ls \;
#UNTITLED# .rhosts dead_letter sent.mail
#aaa# .sh_history dev stand
-y .shrc dtdbcache_c153:0 testmenu
.ICEauthority .sw etc tmp
.TTauthority .windu.c165 export tmp_mnt
.WindU .xsession home tmpfile
.Xauthority aax lib usr
.cshrc ansys_inc lost+found var
.dt bin mbox xaa
.dtprofile cd omnisv.log xxx
.gpmhp-c165 cma_dump.log opt ??3??3@^
.profile core print_info
.pvprinters_ver1 daytasks sbin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2003 12:05 AM
02-28-2003 12:05 AM
Re: find -exec terminated by "+"
Also it doesn't seem to matter what goes into the repeated field, so long as there's something there ....
#find . -name \*sql -exec grep -il gl_data gl_data {} \+
./11325/chg_mine.sql
./11325/code/sp_hkeep_gl_data.sql
./11325/code_11325.sql
#find . -name \*sql -exec grep -il gl_data rubbish {} \+
./11325/chg_mine.sql
./11325/code/sp_hkeep_gl_data.sql
./11325/code_11325.sql
#find . -name \*sql -exec grep -il rubbish gl_data {} \+
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2003 12:10 AM
02-28-2003 12:10 AM
Re: find -exec terminated by "+"
I have made some mor trials.
# find /tmp -name 'aa*' -exec ls {} \;
/tmp/aaa
/tmp/aax
/tmp/aay
# find /tmp -name 'aa*' -exec ls \+
/tmp/aaa /tmp/aax /tmp/aay
It seems as the difference is
This syntax:
find /tmp -name 'aa*' -exec ls {} \;
Result:
ls /tmp/aaa
ls /tmp/aax
ls /tmp/aay
And this syntax:
find /tmp -name 'aa*' -exec ls \+
Result:
ls /tmp/aaa /tmp/aax /tmp/aay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2003 02:08 AM
02-28-2003 02:08 AM
Re: find -exec terminated by "+"
Thanks for humouring me; I've done some further checking into this for you. There's definitely a "feature" in find -exec.
The workaround is to put a junk argument before the braces - as you've seen. If you're interested in getting a fix for this please log a call with your local HP Response Centre and quote the following SR number: 5003435560. I have to state the usual stuff, that we cannot offer timescales for fixes, or guarantee that a fix will be written.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2003 02:11 AM
02-28-2003 02:11 AM
Re: find -exec terminated by "+"
For now I'll live with the ";" terminator in preference to the "+", in spite of it being inefficient.
And thanks to all other contributors.
--Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 04:00 AM
03-03-2003 04:00 AM
Re: find -exec terminated by "+"
Isn't this the same thing as using xargs? I'm quoting James' comments from this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc5620fe6d0f7d61190050090279cd0f9,00.html
====quote====
A 'find' piped to 'xargs' is kinder to your system then a 'find ... -exec'. With '-exec' a new task is spawned for every file to remove. With 'xargs', a large group of files names can be buffered and a single task for that group spawned. For example:
# cd
# find . -type f -print|xargs -n500 rm {}
Regards!
...JRF...
===unquote===
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 05:07 AM
03-03-2003 05:07 AM
Re: find -exec terminated by "+"
Yes it's exactly the same as xargs, just a simpler syntax to remember (if it worked).
--Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 05:23 AM
03-03-2003 05:23 AM
Re: find -exec terminated by "+"
Agreed.
Pete
Pete