How to use an escaped file-name string saved within a bash variable in a new shell command? [duplicate]
Clash Royale CLAN TAG #URR8PPP up vote 2 down vote favorite This question already has an answer here: Why I can't escape spaces on a bash script? [duplicate] 3 answers How to pass directory with escaped space to variable? 3 answers Problem: I have an escaped string saved within a variable: escapedFileName='/dbDumps/Mon Oct 1 15:22:50 UTC 2018.sql' but whenever I try to use this file name within the following command, I get an error message saying that this path does not exist (even though it does). /usr/bin/mysql -u root -pmypassword system < "$escapedFileName"; When i use the path and not the string it works : /usr/bin/mysql -u root -pmypassword system < /dbDumps/Mon Oct 1 15:22:50 UTC 2018.sql What am I doing wrong ? linux bash share | improve this question edited Oct 1 at 20:29 roaima 40.9k 5 47 111 asked Oct 1 at 17:35 Lukas 13 2 New contributor Lukas is a new contributor to this si...