I need to use double quotes in an already double quoted string. I tried using $(...) too, and checked multiple stack posts that were somewhat related [1], [2], but none addressed the issue. These are the commands I am trying to execute -
git submodule foreach 'ssh "${instance_ipaddr}" "[ -d ${REMOTE_GIT_REPO_DIR}/${path}/.git ] || git init ${REMOTE_GIT_REPO_DIR}/${path}"'
git submodule foreach 'submodule_stash_commit=$(git rev-parse HEAD); git push -uf "ssh://${instance_ipaddr}/${REMOTE_GIT_REPO_DIR}/${path}" "${submodule_stash_commit}:refs/heads/remote-push"'
git submodule foreach 'submodule_stash_commit=$(git rev-parse HEAD); ssh "${instance_ipaddr}" "cd ${REMOTE_GIT_REPO_DIR}/${path} && git checkout ${submodule_stash_commit}"'
In these commands I want to replace the single quotes after the git submodule foreach
command.