Timeline for Separate filename and path inside find command's -exec option
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 9, 2015 at 6:23 | comment | added | jbeldock |
Thanks, I see the need for exec now. Just have to wrap my head around the string manipulations. :-)
|
|
| Jan 8, 2015 at 22:57 | comment | added | Gilles 'SO- stop being evil' |
The first command can't work this way: you need to invoke a shell to perform the redirection. What you wrote redirects the output of the find command and all the subprocesses it launches to a file named ~/wiki/newdirectory/{}.cong (with the braces in the file name). @jbeldock
|
|
| Jan 8, 2015 at 22:56 | history | edited | Gilles 'SO- stop being evil' | CC BY-SA 3.0 |
fixed off-by-one error in the second command (the first argument after bash -c SCRIPT is $0)
|
| Jan 8, 2015 at 21:28 | comment | added | iruvar | @jbeldock, added an alternative | |
| Jan 8, 2015 at 21:28 | history | edited | iruvar | CC BY-SA 3.0 |
added 160 characters in body
|
| Jan 8, 2015 at 21:03 | comment | added | jbeldock |
Unfortunately, find is not actually executing inside each file's respective directory with -execdir. This appears possibly to be a known bug in OS X find. I'm poking at it now.
|
|
| Jan 8, 2015 at 20:56 | history | edited | iruvar | CC BY-SA 3.0 |
added 7 characters in body
|
| Jan 8, 2015 at 20:47 | history | answered | iruvar | CC BY-SA 3.0 |