Programmatically edit file section including section headershell Script: Sorting files into directories and...

As a DM, how to avoid unconscious metagaming when dealing with a high AC character?

How to make 1,1-diphenyl-1-butene from benzophenone and 1-bromopropane?

Players of unusual orchestral instruments

Where is my understanding of TikZ styles wrong?

Can a continent naturally split into two distant parts within a week?

Why doesn't the Lars family (and thus Luke) speak Huttese as their first language?

How does one stock fund's charge of 1% more in operating expenses than another fund lower expected returns by 10%?

To accent or not to accent in Greek

Dropping outliers based on "2.5 times the RMSE"

Why does the trade federation become so alarmed upon learning the ambassadors are Jedi Knights?

Is `curl {something} | sudo bash -` a reasonably safe installation method?

I quit, and boss offered me 3 month "grace period" where I could still come back

Cubic programming and beyond?

Should you avoid redundant information after dialogue?

Why does Hellboy file down his horns?

Why do they not say "The Baby"

How can an advanced civilization forget how to manufacture its technology?

Help with understanding nuances of extremely popular Kyoto-ben (?) tweet

How to convert 1k to 1000 and 1m to 1000000 in Excel

Was adding milk to tea started to reduce employee tea break time?

Was the Ford Model T black because of the speed black paint dries?

latinate or other words of foreign origin as opposed to Germanic words

When did the Roman Empire fall according to contemporaries?

What would be the ideal melee weapon made of "Phase Metal"?



Programmatically edit file section including section header


shell Script: Sorting files into directories and subdirectoriesbash shell script that creates directoriesHow to create a list of items under specific headings in a text document? (Linux/Bash)Shell script to add different GPS data to series of photosMove file based on conditionNeed to pass multiple values from a file as an argumentRead User Input and then outputted to a fileScript to capture and send data to PCScripting: Skipping n filesdelete everything before specific position in a text file






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















We all know the error File contains no sections headers which often occurs when section headers are missing in configuration files.



I want to read/write a configuration file : lets say one section.
My shell script will say :
If conditionA is true, then create section header [ABC] and write line1, line2
If conditionB is true, then go to section header [ABC] and change line1 to line1_1 and add line3 after line2



Could you help me write such a script if at all possible ?









share







New contributor



user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    0















    We all know the error File contains no sections headers which often occurs when section headers are missing in configuration files.



    I want to read/write a configuration file : lets say one section.
    My shell script will say :
    If conditionA is true, then create section header [ABC] and write line1, line2
    If conditionB is true, then go to section header [ABC] and change line1 to line1_1 and add line3 after line2



    Could you help me write such a script if at all possible ?









    share







    New contributor



    user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      0












      0








      0








      We all know the error File contains no sections headers which often occurs when section headers are missing in configuration files.



      I want to read/write a configuration file : lets say one section.
      My shell script will say :
      If conditionA is true, then create section header [ABC] and write line1, line2
      If conditionB is true, then go to section header [ABC] and change line1 to line1_1 and add line3 after line2



      Could you help me write such a script if at all possible ?









      share







      New contributor



      user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      We all know the error File contains no sections headers which often occurs when section headers are missing in configuration files.



      I want to read/write a configuration file : lets say one section.
      My shell script will say :
      If conditionA is true, then create section header [ABC] and write line1, line2
      If conditionB is true, then go to section header [ABC] and change line1 to line1_1 and add line3 after line2



      Could you help me write such a script if at all possible ?







      shell-script





      share







      New contributor



      user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share







      New contributor



      user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      share



      share






      New contributor



      user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 4 mins ago









      user362259user362259

      1




      1




      New contributor



      user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      user362259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
























          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
          });


          }
          });






          user362259 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f530040%2fprogrammatically-edit-file-section-including-section-header%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








          user362259 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          user362259 is a new contributor. Be nice, and check out our Code of Conduct.













          user362259 is a new contributor. Be nice, and check out our Code of Conduct.












          user362259 is a new contributor. Be nice, and check out our Code of Conduct.
















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f530040%2fprogrammatically-edit-file-section-including-section-header%23new-answer', 'question_page');
          }
          );

          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







          Popular posts from this blog

          Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

          The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

          Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...