19
rated 0 times
[
19]
[
0]
/ answers: 1 / hits: 3323
/ 3 Years ago, wed, may 12, 2021, 3:21:00
I'm trying to pipe the result of a find
command to a bash script. This is to simplify (maybe automate) a process I have been working on.
This is the command I would like to run
find . -type f -iname '*.mp4' -exec echo {}|./indexer.sh ;
indexer.sh
is ofc chmod +x
so it can execute.
indexer.sh
currently contains
#!/bin/zsh
read foo
echo "You entered '$foo'"
And if I run $ echo foo | ./indexer.sh
I get the output of
You entered 'foo'
But when I run find . -type f -iname '*.mp4' -exec echo {}|./indexer.sh ;
I receive the following error message:
find: -exec: no terminating ";" or "+"
You entered ''
So how can I pipe the output of find, into my script?
More From » bash