When using the find program with the -execdir option, I have seen people say the {} will be replaced with the directory and the + with the filename, but the manual does not say what these do. Is there some official documentation that explains this? Also I want to know if they get expanded as relative or absolute paths. I tried creating a script that would take the {} and the + as parameters and save their contents to separate files. I assumed they would get passed as two separate parameters and this would allow me to see how each one is expanded, but the results I am getting make it seem only a single parameter is being passed to the script, so I still can't completely prove to myself what these are and how they are expanded.Here is the command I am running: find '/home/jesse/hacking/sh_sandbox' -type f -execdir /home/jesse/hacking/sh_sandbox/save_params.sh {} +The save_params.sh script is an executable shell script with the following code:echo $0 >> /home/jesse/hacking/sh_sandbox/zero_param.txtecho $1 >> /home/jesse/hacking/sh_sandbox/first_param.txtecho $2 >> /home/jesse/hacking/sh_sandbox/second_param.txtecho $3 >> /home/jesse/hacking/sh_sandbox/third_param.txtThe zero_param text file gets filled with the name of the script that is executing, which is expected. The first_param.txt file is getting filled with ./filename with different filenames. Both the second_param and third_param text files are filled with blank lines each with the same number of lines as the other files. This is what leads to me to believe there is no second parameter being passed to save_params.sh.
How do the {} and + get expanded inside find with the -execdir option
find
+ is the end marker , {} is replaced with the filenames the current directory is the path.so$PWD = /home/jesse/hacking/sh_sandbox/$0 = /home/jesse/hacking/sh_sandbox/save_params.sh$1 = ./zero_param.txt$2 = ./first_param.txt$3 = ./second_param.txt$4 = ./third_param.txtor something like that... re-reading the question it seems that the script is written to modify the directory that's being searched by find, so what really happens may be more complex. on the first run there's only one file found$PWD = /home/jesse/hacking/sh_sandbox/$0 = /home/jesse/hacking/sh_sandbox/save_params.sh$1 = ./save_params.shso the files would be created with content to reflect that.