Regex to split a CSV

Description Instead of using a split, I think it would be easier to simply execute a match and process all the found matches. This expression will: divide your sample text on the comma delimits will process empty values will ignore double quoted commas, providing double quotes are not nested trims the delimiting comma from the … Read more

How to execute a bash command stored as a string with quotes and asterisk [duplicate]

Have you tried: eval $cmd For the follow-on question of how to escape * since it has special meaning when it’s naked or in double quoted strings: use single quotes. MYSQL=’mysql AMORE -u username -ppassword -h localhost -e’ QUERY=”SELECT “‘*'” FROM amoreconfig” ;# <– “double”‘single'”double” eval $MYSQL “‘$QUERY'” Bonus: It also reads nice: eval mysql … Read more