I have a sed processing.It works well in CLI in my mac.but when they are placed in script,it does not work.
I use a dictionary.
declare -A dict
dict[$opt]=admin_feature/ci_75bfb33
dict[$opt]=`echo "${dict[$opt]}"|sed -E ':a s/^([^_]*_.*)[/_](.*_[^_]*$)/\1-\2/; ta'`
echo ${dict[$opt]}
admin_feature-ci_75bfb33
Comments
Post a Comment