I have some commands I want to execute in a bash script.
Now when we use single quotes the variable is taken literal and not the value.
So doing e.g. ls "$SOME_DIR"
is not the same as ls '$SOME_DIR'
How can we handle a mix of quotes and double quotes in a way that not everything is cluttered by escaping double quotes?
E.g. how to valid something like:
ssh server.com "mkdir \"/foo/bar/"$final"\""
How can I avoid all these escapes since the longer the commands it becomes unreadable and very easy to break?
rsync
ortar c . | ssh tar x x -C /
.