Last active
September 5, 2018 16:19
-
-
Save weaver299/d8d83b4b406f8b2abeb01f1194a928b1 to your computer and use it in GitHub Desktop.
Can't output desired string with "..." in bash??
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This outputs "\$conf" as desired | |
echo $'s/^(\\$conf\\[\'simplesamlphp_auth_installdir\'\\] = .*)/if(whatever){ $1 } else { whatever };/' | |
# Yes, it can also be done with this craziness | |
echo 's/^(\$conf\['"'"'simplesamlphp_auth_installdir'"'"'\] = .*)/if(whatever){ $1 } else { whatever };/' | |
# But it doesn't seem to be possible with "..." ? | |
echo "s/^(\$conf\['simplesamlphp_auth_installdir'\] = .*)/if(whatever){ \$1 } else { whatever };/" | |
echo "s/^(\\$conf\['simplesamlphp_auth_installdir'\] = .*)/if(whatever){ \$1 } else { whatever };/" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment