| #/bin/bash |
| |
| insert_place=$1 |
| feature_info=$2 |
| |
| function usage { |
| printf "./insert_paras.sh [INSERT_PLACE] [TXT_FILE_TO_INSERT] \n" |
| printf "[INSERT_PLACE]: The feature option that you want to insert after. \n" |
| printf "[TXT_FILE_TO_INSERT]: The paragraph that you want to insert for\ |
| the new feature option.\n" |
| } |
| |
| echo "Insert place: $1" |
| echo "Inserted file: $2" |
| |
| if [ $# -ne 2 ]; then |
| echo "Wrong usage, it should be:" |
| usage |
| exit 1 |
| fi |
| |
| for entry in config/* |
| do |
| echo "Folder: $entry" |
| sed -i "/$insert_place =/r $2" $entry/internal_feature_option |
| done |
| |
| |