Find And Edit Line in FileHow can I cat the contents of files found using find into a single file?How can I...

Bent spoke design wheels — feasible?

How to translate “Me doing X” like in online posts?

Movie about a boy who was born old and grew young

About the expansion of seq_set_split

Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut

How hard would it be to convert a glider into an powered electric aircraft?

Do the English have an ancient (obsolete) verb for the action of the book opening?

Can a user sell my software (MIT license) without modification?

Trapping Rain Water

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

How to make a setting relevant?

Random Portfolios vs Efficient Frontier

Are "living" organ banks practical?

How can drunken, homicidal elves successfully conduct a wild hunt?

Traffic law UK, pedestrians

Should I "tell" my exposition or give it through dialogue?

Smooth switching between 12v batteries, with toggle switch

What risks are there when you clear your cookies instead of logging off?

Why does Kathryn say this in 12 Monkeys?

Deformation of rectangular plot

Can you really not move between grapples/shoves?

Subtables with equal width?

Notation of last measure of a song with a pickup measure

How to pass a regex when finding a directory path in bash?



Find And Edit Line in File


How can I cat the contents of files found using find into a single file?How can I insert the contents of a file into a string in bashHow to log every command typed into bash and every file operationFind differences in file and sorting file by keyFind line within file matching pattern and make a substitutionLoop through read only .zip data archive to extract line from .kml file withingrepping array from file and reusing search patternRemove rows from a file that exist in another file with newer timestampPipe to log file with today's date contained in filenameSimple method for copying a file and preserving it's path?






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







0















I’m relatively new to bash scripting and am
looking for the best way to make changes to a line in a file.



For instance, if some file contains a line:



...
OPTION=“—option1 —option2 param —option3 —option4”
...


What would be the best combination of utilities
to:




  • Find that line in the file (assume it’s the only line with the string ‘OPTION’


  • append to the option string so it’s now:



    OPTION=“—option1 —option2 param —option3 —option4”



Any help on which are the right tools to accomplish the job would be helpful! Thanks :)









share









New contributor



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


























    0















    I’m relatively new to bash scripting and am
    looking for the best way to make changes to a line in a file.



    For instance, if some file contains a line:



    ...
    OPTION=“—option1 —option2 param —option3 —option4”
    ...


    What would be the best combination of utilities
    to:




    • Find that line in the file (assume it’s the only line with the string ‘OPTION’


    • append to the option string so it’s now:



      OPTION=“—option1 —option2 param —option3 —option4”



    Any help on which are the right tools to accomplish the job would be helpful! Thanks :)









    share









    New contributor



    jarrodtb 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








      I’m relatively new to bash scripting and am
      looking for the best way to make changes to a line in a file.



      For instance, if some file contains a line:



      ...
      OPTION=“—option1 —option2 param —option3 —option4”
      ...


      What would be the best combination of utilities
      to:




      • Find that line in the file (assume it’s the only line with the string ‘OPTION’


      • append to the option string so it’s now:



        OPTION=“—option1 —option2 param —option3 —option4”



      Any help on which are the right tools to accomplish the job would be helpful! Thanks :)









      share









      New contributor



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











      I’m relatively new to bash scripting and am
      looking for the best way to make changes to a line in a file.



      For instance, if some file contains a line:



      ...
      OPTION=“—option1 —option2 param —option3 —option4”
      ...


      What would be the best combination of utilities
      to:




      • Find that line in the file (assume it’s the only line with the string ‘OPTION’


      • append to the option string so it’s now:



        OPTION=“—option1 —option2 param —option3 —option4”



      Any help on which are the right tools to accomplish the job would be helpful! Thanks :)







      bash shell-script





      share









      New contributor



      jarrodtb 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



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







      share



      share








      edited 5 mins ago









      Michael Homer

      52.8k9146183




      52.8k9146183






      New contributor



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








      asked 9 mins ago









      jarrodtbjarrodtb

      1




      1




      New contributor



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




      New contributor




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


          }
          });






          jarrodtb 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%2f522525%2ffind-and-edit-line-in-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








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










          draft saved

          draft discarded


















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













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












          jarrodtb 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%2f522525%2ffind-and-edit-line-in-file%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

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m