kif1205 / Python

0 stars 0 forks source link

sed examples #31

Open kif1205 opened 5 years ago

kif1205 commented 5 years ago

sed -i 's/"LogEFIStatusCodes": "[A-z|0-9|:punct:|.| ]*"/"LogEFIStatusCodes": "Error code"/' /etc/bios_current.json

kif1205 commented 5 years ago

MaxCountOfEventSubscriptions in eventingMode.conf is below :

MaxCountOfEventSubscriptions=100

Command : "sed -n '/^MaxCountOfEventSubscriptions=/ {s///p;q;}' /usr/local/etc/nginx/eventingMode.conf

Output : 100

kif1205 commented 5 years ago

Replace EventingMechanism=* as EventingMechanism=0

Command : sed -i 's/EventingMechanism=[A-z|0-9|:punct:|.| |,|/]*/EventingMechanism=0" + "/' " + EventingMode_Conf_File_Path

kif1205 commented 5 years ago

https://stackoverflow.com/questions/26709600/get-value-of-parameter-from-text-file-using-sed

kif1205 commented 5 years ago

2019.08.20

Command :

sed -n '/^[ ]*"DependencyFor": "Era/ {=s///p;q;}' /usr/local/nginx/www/BiosAttributeRegistry/VertivBiosAttributeRegistry.1.0.0.json

Result :

928
seSEL",

=> 928 is the match number ,' seSEL", ' is the match word


Result :

928
kif1205 commented 5 years ago

2019.08.20

Original

                    "MapToProperty": "GrayOut",
                    "MapToValue": true
                },
                "DependencyFor":"fdsafsadfas",
                "Type": "Map"
            },
            {
                "Dependency": {

920~930 "DependencyFor":[A-z|0-9|:punct:|.| |,|/|\"]*, =>"DependencyFor":"123",

sed -i '920,930s/"DependencyFor":[A-z|0-9|:punct:|.| |,|/|\"]*,/"DependencyFor":"123",/g' /usr/local/nginx/www/BiosAttributeRegistry/VertivBiosAttributeRegistry.1.0.0.json

Result :

                    "MapToProperty": "GrayOut",
                    "MapToValue": true
                },
                "DependencyFor":"123",
                "Type": "Map"
            },
            {
                "Dependency": {
kif1205 commented 5 years ago

2019.08.28