Skip to content

Instantly share code, notes, and snippets.

@navono navono/prefix.sh
Created Jun 12, 2019

Embed
What would you like to do?
add prefix string in list
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
You can’t perform that action at this time.