Created
June 12, 2019 00:28
-
-
Save navono/dcf4fe68eb33497e8b7dcb8d28139ca4 to your computer and use it in GitHub Desktop.
add prefix string in list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MYLIST=(var1 var2 var3) | |
| echo ${MYLIST[@]/#/my_} | |
| # Output: my_var1 my_var2 my_var3 | |
| DATABASE="database1" | |
| IGNORE_TABLES=(table1 table2 table3) | |
| echo mysqldump ${IGNORE_TABLES[@]/#/--ignore-table=${DATABASE}.} ${DATABASE} | |
| # Output: mysqldump --ignore-table=database1.table1 --ignore-table=database1.table2 --ignore-table=database1.table3 database1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment