skip to Main Content

Why isn’t sed working with certain string characters in Ubuntu?

I have been reading through the various sed issues and have one I cannot get to work: I want to replace: define('CIVICRM_LOGGING_DSN', CIVICRM_DSN); With define('CIVICRM_LOGGING_DSN', myuser:mypassword@localhost:3306civicrm_uat_logs); This almost works... sed -i -e "s/define('CIVICRM_LOGGING_DSN', CIVICRM_DSN);/define('CIVICRM_LOGGING_DSN', 'myuser:mypassword@localhost:3306civicrm_uat_logs');/" /my_path/civicrm.settings.php The output is: define('CIVICRM_LOGGING_DSN',…

VIEW QUESTION

scrape a file and delete lines with a certain range of numbers – Ubuntu

I am trying to scrape a file with content similar to this this: "addressString":"12366 NY","eId":"64174f8e42b7fdfb837f68b","hasImage":false,"Price":5800,"Name":Bernard Bernoulli,"headline":"nice Fiat 500, red, slight damage to left mirror" "addressString":"451 Citadel","eId":"sd3448e42b7368b","year":1976,"hasImage":true,"Price":12220,"Name":Edward Diego,"headline":"Mercedes SLX, no issues" "addressString":"1321 Bejing","eId":"3102ffdb837fssdff3","Price":350,"Name":Jet Li,"headline":"Dodge Viper, no engine, no tires, no windshield;…

VIEW QUESTION

sed/awk hide/mask field in a json file

I am trying to mask/hide a value of a field in a json file. I have json that looks something like this: "PLUSDATA": { "global": { "auth_type": "login", "passkey": "SENSETIVE_CONTENT_TO_BE_HIDDEN", "src_intf": "Loopback0", "timeout": "5" } }, I'd like to parse…

VIEW QUESTION
Back To Top
Search