I have string which looks like this:
/mnt/blumeta0/db2/head/home/db2inst1/sqllib/ctrlha/ /mnt/blumeta0/db2/head/home/db2inst1/sqllib/ctrl/ /mnt/blumeta0/db2/head/home/db2inst1/sqllib/log/ /mnt/blumeta0/db2/head/home/db2inst1/sqllib/cfg/
This is stored in variable sqllib_files_folders
in the script below : I am trying to remove all occurences of prefix TMP_SOTRAGE
which is /mnt/blumeta0/db2
for which I wrote the following:
#!/bin/sh
TMP_STORAGE="/mnt/blumeta0/db2"
METADATA_PATH="/head"
sqllib_files_folders=$(find $TMP_STORAGE$METADATA_PATH/home/db2inst1/sqllib/ -maxdepth 1 -mindepth 1 '(' '(' -type d -printf '%p/ ' ')' -o -printf '%p ' ')')
sqllib_files_folders=echo ${sqllib_files_folders//$TMP_STORAGE/}
echo $sqllib_files_folders
This works for string which does not have /
. I have tried escaping with \
. But that does not work either. Any help please?