bash - Change the text within a file so that the text is now corresponding to the subdirectory -
i need change text within each parameter file located in each subdirectory. there 361 subdirectories.
excerpt parameter file:
pdb foldername
from: ~josh/documents/model_files/analysis/foldername
foldername needs correspond each subdirectory in parameter file located. how do 361 subdirectories using shell in terminal? (i not familiar batch , of stuff.)
something that:
find . -mindepth 2 -name "*" -exec sh -c 'sed -i "s,pbd foldername,pbd $(echo $(basename $(dirname {})))," {}' \;
Comments
Post a Comment