How to use parameter expansion with find -exec ?

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to incorporate something like:
for f in */*; do mv "$f" "$f%/*/foo.$f##*."; done
Into my find x -exec y ;-style workflow.
The for loop construct & "$f" variable will likely be omitted; the loop will be substituted by standard -exec iterating behaviour, and the variable (containing the filename of the current iteration), by .
But it seems like these two different syntaxes are incompatible/problematic. Especially because of the conflicting braces and semicolons, etc.
shell-script find exec parameter bash-expansion
add a comment |Â
up vote
0
down vote
favorite
I want to incorporate something like:
for f in */*; do mv "$f" "$f%/*/foo.$f##*."; done
Into my find x -exec y ;-style workflow.
The for loop construct & "$f" variable will likely be omitted; the loop will be substituted by standard -exec iterating behaviour, and the variable (containing the filename of the current iteration), by .
But it seems like these two different syntaxes are incompatible/problematic. Especially because of the conflicting braces and semicolons, etc.
shell-script find exec parameter bash-expansion
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to incorporate something like:
for f in */*; do mv "$f" "$f%/*/foo.$f##*."; done
Into my find x -exec y ;-style workflow.
The for loop construct & "$f" variable will likely be omitted; the loop will be substituted by standard -exec iterating behaviour, and the variable (containing the filename of the current iteration), by .
But it seems like these two different syntaxes are incompatible/problematic. Especially because of the conflicting braces and semicolons, etc.
shell-script find exec parameter bash-expansion
I want to incorporate something like:
for f in */*; do mv "$f" "$f%/*/foo.$f##*."; done
Into my find x -exec y ;-style workflow.
The for loop construct & "$f" variable will likely be omitted; the loop will be substituted by standard -exec iterating behaviour, and the variable (containing the filename of the current iteration), by .
But it seems like these two different syntaxes are incompatible/problematic. Especially because of the conflicting braces and semicolons, etc.
shell-script find exec parameter bash-expansion
shell-script find exec parameter bash-expansion
asked 8 mins ago
tjt263
5101420
5101420
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476763%2fhow-to-use-parameter-expansion-with-find-exec%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password