Replace part of a vdf file Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionbash replace part of string based on locationHow to replace “&” with “&” except when already part of an XML entity?vi — replace chars from part of lineReplace part of filename by directory nameReplace values in fileLinux replace only user part in email patternreplace tab with spaceHow to find and replace multiple field values using jq?sh script to replace IP address from a file with one stored in a text filesed? - replace part of line if match from another file found
Take 2! Is this homebrew Lady of Pain warlock patron balanced?
What is this clumpy 20-30cm high yellow-flowered plant?
Do wooden building fires get hotter than 600°C?
Why is it faster to reheat something than it is to cook it?
Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?
How would a mousetrap for use in space work?
How fail-safe is nr as stop bytes?
Performance gap between vector<bool> and array
Is CEO the "profession" with the most psychopaths?
How do living politicians protect their readily obtainable signatures from misuse?
Illegal assignment from sObject to Id
How does the math work when buying airline miles?
How to write this math term? with cases it isn't working
How much damage would a cupful of neutron star matter do to the Earth?
What would you call this weird metallic apparatus that allows you to lift people?
Is a ledger board required if the side of my house is wood?
Sum letters are not two different
Dating a Former Employee
What is the difference between globalisation and imperialism?
Using audio cues to encourage good posture
Can a new player join a group only when a new campaign starts?
Can anything be seen from the center of the Boötes void? How dark would it be?
Does the Weapon Master feat grant you a fighting style?
How often does castling occur in grandmaster games?
Replace part of a vdf file
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionbash replace part of string based on locationHow to replace “&” with “&” except when already part of an XML entity?vi — replace chars from part of lineReplace part of filename by directory nameReplace values in fileLinux replace only user part in email patternreplace tab with spaceHow to find and replace multiple field values using jq?sh script to replace IP address from a file with one stored in a text filesed? - replace part of line if match from another file found
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Again I am attempting to alter configuration file via script.
I looked into jq but jq seems to support the .json format alone.
.vdf is almost exactly like .json except that there are no commas.
here is an attempt at what I want to do but with sed.
#!/bin/bash
text_to_find=' "9420"
"LastPlayed" ".*"
'
text_to_put=' "9420"
"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile
that returns: "sed: -e expression #1, char 13: unterminated `s' command"
and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.
here's an example of the test file :
https://pastebin.com/qFcEhTEf
shell-script shell sed jq
add a comment |
Again I am attempting to alter configuration file via script.
I looked into jq but jq seems to support the .json format alone.
.vdf is almost exactly like .json except that there are no commas.
here is an attempt at what I want to do but with sed.
#!/bin/bash
text_to_find=' "9420"
"LastPlayed" ".*"
'
text_to_put=' "9420"
"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile
that returns: "sed: -e expression #1, char 13: unterminated `s' command"
and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.
here's an example of the test file :
https://pastebin.com/qFcEhTEf
shell-script shell sed jq
it's not JSON. as specifically stated. it is VDF. so again not JSON
– tatsu
Apr 15 at 10:05
add a comment |
Again I am attempting to alter configuration file via script.
I looked into jq but jq seems to support the .json format alone.
.vdf is almost exactly like .json except that there are no commas.
here is an attempt at what I want to do but with sed.
#!/bin/bash
text_to_find=' "9420"
"LastPlayed" ".*"
'
text_to_put=' "9420"
"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile
that returns: "sed: -e expression #1, char 13: unterminated `s' command"
and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.
here's an example of the test file :
https://pastebin.com/qFcEhTEf
shell-script shell sed jq
Again I am attempting to alter configuration file via script.
I looked into jq but jq seems to support the .json format alone.
.vdf is almost exactly like .json except that there are no commas.
here is an attempt at what I want to do but with sed.
#!/bin/bash
text_to_find=' "9420"
"LastPlayed" ".*"
'
text_to_put=' "9420"
"LastPlayed" "1554153269"
"ViewedLaunchEULA" "1"
"ViewedSteamPlay" "1"
"BadgeData" "02000000080b"
"LaunchOptions" "PROTON_NO_ESYNC=1, PROTON_DUMP_DEBUG_COMMANDS=1 %command%"
'
sed -i "s|$text_to_find|$text_to_put|1" myTestFile
that returns: "sed: -e expression #1, char 13: unterminated `s' command"
and it probably would fail to match Last played because I don't think in this context ".*" would still be interpreted.
here's an example of the test file :
https://pastebin.com/qFcEhTEf
shell-script shell sed jq
shell-script shell sed jq
edited Apr 14 at 15:15
tatsu
asked Apr 14 at 15:00
tatsutatsu
1487
1487
it's not JSON. as specifically stated. it is VDF. so again not JSON
– tatsu
Apr 15 at 10:05
add a comment |
it's not JSON. as specifically stated. it is VDF. so again not JSON
– tatsu
Apr 15 at 10:05
it's not JSON. as specifically stated. it is VDF. so again not JSON
– tatsu
Apr 15 at 10:05
it's not JSON. as specifically stated. it is VDF. so again not JSON
– tatsu
Apr 15 at 10:05
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512427%2freplace-part-of-a-vdf-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f512427%2freplace-part-of-a-vdf-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
it's not JSON. as specifically stated. it is VDF. so again not JSON
– tatsu
Apr 15 at 10:05