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

Replace version inside YAML file – Ubuntu

I have this YAML file: openapi: 3.0.0 info: title: Test description: >- This is the official REST API documentation for all available routes provided by the **Test** plugin. version: 2.0.0 servers: - url: https://entwicklungsumgebung components: securitySchemes: basicAuth: type: http Inside…

VIEW QUESTION

Sorting a JSON file by outer object name

I have a json file input.json thus: { "foo":{ "prefix":"abc", "body":[1,2,3] }, "bar":{ "prefix":"def", "body":[4,5,6] } } I would like to sort it by the outer object names, with "bar" coming before "foo" in alphabetical order like so: { "bar":{…

VIEW QUESTION
Back To Top
Search