Well, I think you can find dozens of questions on this platform how to pipe find output to sed, but I haven't found anything for the reverse direction so far. What I want to do is modify my input, and then pass it to find.Supposing I want to do something like the following, in order to make life easier for myself by avoiding to type in those cumbersome asterisk wildcards. (I hope it's obvious enough that the expression which follows the here-string operator <<< is eventually planned to get replaced by a parameter, e. g. $1, in a script later. The line below is merely for demonstration.)$ sed 's/ /\*/g' <<< ' foo bar baz ' | find . -type f -iname - That - at the end of this one-liner was actually supposed to use the output of sed as input for find; however, extending the find part to ... find -D tree . -type f -iname - ... revealed that the parameter was not passed to find. Perhaps you cannot pass pre-processed input to find using a pipe at all?
Passing parsed output of sed to find (in this direction)
bash;sed;find;pipe;parameter
find doesn't take its args from stdin, it takes them from the command line, so:find . -iname $(sed 's/ /\*/g' <<< ' foo bar baz ')That will become:find . -iname foo*bar*baz*(the quotes are necessary to stop the shell from expanding the wildcard foo*bar*baz*)which may or may not be what you were hoping to get.  e.g. if you really wanted files beginning with either foo, bar, or baz rather than files matching the patter 'foo*bar*baz*' then you need to construct a regexp and use -regex or -iregex rather than -iname.  or construct a more complicated find command like -iname 'foo*' -o -iname 'bar*' -o -iname 'baz*'alternatively:PATTERN='foo bar baz'PATTERN=$(echo $PATTERN | sed -e 's/ /*/g')# and/or do whatever else you need to do to transform $PATTERN to be what# you need it to be...find . -iname $PATTERNHere's the one-liner in a bash script.  it works exactly the same in the script as it does on the command-line.$ cat ./test.sh#! /bin/bash find . -iname $(sed 's/ /\*/g' <<< ' foo bar baz ')$ ls -ltotal 4-rw-r--r-- 1 cas cas  0 Sep 26 16:53 doesntmatchlrwxrwxrwx 1 cas cas 16 Sep 26 16:59 symlink -> xfoo-ybar-zbaz01-rwxr-xr-x 1 cas cas 69 Sep 26 16:50 test.sh-rw-r--r-- 1 cas cas  0 Sep 26 16:50 xfoo-ybar-zbaz01-rw-r--r-- 1 cas cas  0 Sep 26 16:50 xfoo-ybar-zbaz02-rw-r--r-- 1 cas cas  0 Sep 26 16:50 xfoo-ybar-zbaz03$ ./test.sh ./xfoo-ybar-zbaz01./xfoo-ybar-zbaz03./xfoo-ybar-zbaz02$ find . -iname $(sed 's/ /\*/g' <<< ' foo bar baz ')./xfoo-ybar-zbaz01./xfoo-ybar-zbaz03./xfoo-ybar-zbaz02$ find . -iname *foo*bar*baz*./xfoo-ybar-zbaz01./xfoo-ybar-zbaz03./xfoo-ybar-zbaz02