Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

sed can not work in script.but can work in CLI

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