rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #/bin/bash |
| 2 | |
| 3 | insert_place=$1 |
| 4 | feature_info=$2 |
| 5 | |
| 6 | function usage { |
| 7 | printf "./insert_paras.sh [INSERT_PLACE] [TXT_FILE_TO_INSERT] \n" |
| 8 | printf "[INSERT_PLACE]: The feature option that you want to insert after. \n" |
| 9 | printf "[TXT_FILE_TO_INSERT]: The paragraph that you want to insert for\ |
| 10 | the new feature option.\n" |
| 11 | } |
| 12 | |
| 13 | echo "Insert place: $1" |
| 14 | echo "Inserted file: $2" |
| 15 | |
| 16 | if [ $# -ne 2 ]; then |
| 17 | echo "Wrong usage, it should be:" |
| 18 | usage |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
| 22 | for entry in config/* |
| 23 | do |
| 24 | echo "Folder: $entry" |
| 25 | sed -i "/$insert_place =/r $2" $entry/internal_feature_option |
| 26 | done |
| 27 | |
| 28 | |