I'm working on a portable anaconda package, and I'm trying to use find and sed to find all files and replace a path within the files within the current directory and its subdirectories.
When I execute the command, however, sed throws the error:
sed: couldn't edit anaconda3: not a regular file
The command I'm using is:
find ./ -type f -exec sed -i -e "s+/opt/conda_tools+$TOOLKIT_DIR+g" * {} \;
I'm using + as the delimiter since the / are part of the path. The contents of the directory I'm executing the script in is:
drwxr-xr-x 24 test_user linuxusers 4096 Nov 21 16:07 anaconda3
Executing the find command on its own lists the files as expected, but for some reason the directory name is being picked up still. I've also tried the following variation of the command with no success:
find ./ -type f -exec sed -i '' "s+/opt/conda_tools+$INSTALL_DIR+g" * {} \;
I've used find and sed successfully before, but I'm a bit stumped where to look next. Is there anything that obviously wrong that I'm missing here, or not so obvious?