EDITOR: subsidiary program 'emacs -nw' not found [duplicate]












0
















This question already has an answer here:




  • Export EDITOR with a flag

    1 answer




I have set up



$ echo $EDITOR
emacs -nw


I was wondering why it is not found here, and how I can solve the problem? Thanks.



$ sdiff -o sdiff.out f1 f2
1 2 3 | 2 3 4
%e1
sdiff: subsidiary program 'emacs -nw' not found


I don't know why an option in $EDITOR is a problem, and where it is required in sdiff source code? I guess it is here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n459



prog = getenv ("EDITOR");
if (prog)
editor_program = prog;


and here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1035



execvp (editor_program, (char **) argv);


or http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1018 and http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1024. I am not sure what the program is doing.



For comparison, the following works perfectly fine:



$ eval "$EDITOR"









share|improve this question















marked as duplicate by Jeff Schaller, Thomas, Stephen Kitt, G-Man, Isaac Nov 18 '18 at 21:53


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    0
















    This question already has an answer here:




    • Export EDITOR with a flag

      1 answer




    I have set up



    $ echo $EDITOR
    emacs -nw


    I was wondering why it is not found here, and how I can solve the problem? Thanks.



    $ sdiff -o sdiff.out f1 f2
    1 2 3 | 2 3 4
    %e1
    sdiff: subsidiary program 'emacs -nw' not found


    I don't know why an option in $EDITOR is a problem, and where it is required in sdiff source code? I guess it is here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n459



    prog = getenv ("EDITOR");
    if (prog)
    editor_program = prog;


    and here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1035



    execvp (editor_program, (char **) argv);


    or http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1018 and http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1024. I am not sure what the program is doing.



    For comparison, the following works perfectly fine:



    $ eval "$EDITOR"









    share|improve this question















    marked as duplicate by Jeff Schaller, Thomas, Stephen Kitt, G-Man, Isaac Nov 18 '18 at 21:53


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      0












      0








      0









      This question already has an answer here:




      • Export EDITOR with a flag

        1 answer




      I have set up



      $ echo $EDITOR
      emacs -nw


      I was wondering why it is not found here, and how I can solve the problem? Thanks.



      $ sdiff -o sdiff.out f1 f2
      1 2 3 | 2 3 4
      %e1
      sdiff: subsidiary program 'emacs -nw' not found


      I don't know why an option in $EDITOR is a problem, and where it is required in sdiff source code? I guess it is here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n459



      prog = getenv ("EDITOR");
      if (prog)
      editor_program = prog;


      and here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1035



      execvp (editor_program, (char **) argv);


      or http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1018 and http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1024. I am not sure what the program is doing.



      For comparison, the following works perfectly fine:



      $ eval "$EDITOR"









      share|improve this question

















      This question already has an answer here:




      • Export EDITOR with a flag

        1 answer




      I have set up



      $ echo $EDITOR
      emacs -nw


      I was wondering why it is not found here, and how I can solve the problem? Thanks.



      $ sdiff -o sdiff.out f1 f2
      1 2 3 | 2 3 4
      %e1
      sdiff: subsidiary program 'emacs -nw' not found


      I don't know why an option in $EDITOR is a problem, and where it is required in sdiff source code? I guess it is here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n459



      prog = getenv ("EDITOR");
      if (prog)
      editor_program = prog;


      and here http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1035



      execvp (editor_program, (char **) argv);


      or http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1018 and http://git.savannah.gnu.org/cgit/diffutils.git/tree/src/sdiff.c#n1024. I am not sure what the program is doing.



      For comparison, the following works perfectly fine:



      $ eval "$EDITOR"




      This question already has an answer here:




      • Export EDITOR with a flag

        1 answer








      emacs editors diffutils sdiff






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 18 '18 at 14:21







      Tim

















      asked Nov 18 '18 at 13:26









      TimTim

      26.4k75251461




      26.4k75251461




      marked as duplicate by Jeff Schaller, Thomas, Stephen Kitt, G-Man, Isaac Nov 18 '18 at 21:53


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by Jeff Schaller, Thomas, Stephen Kitt, G-Man, Isaac Nov 18 '18 at 21:53


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          4














          It's apparent that sdiff attempted to execute a program named exactly emacs -nw, which didn't exist. Your intention was for sdiff to call emacs with an option -nw followed by the file(s).



          The behavior is confirmed by looking at the sdiff source code, where sdiff populates the preferred editor --directly-- into argv[0], which puts the <space><dash>nw together with the emacs. You could also confirm that sdiff is generally working correctly by setting EDITOR=emacs and observing that it opens emacs.



          If you need the option when opening emacs, then my suggestion would be to create a wrapper script:



          $ cat emacs.sh
          #!/bin/sh

          vi "$@"


          Just kidding, of course. You'd use:



          $ cat emacs.sh
          #!/bin/sh

          emacs -nw "$@"


          ... and then set EDITOR=/path/to/that/emacs.sh






          share|improve this answer





















          • 1





            Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

            – filbranden
            Nov 18 '18 at 16:24











          • Small suggestion to use exec when invoking emacs from the script.

            – filbranden
            Nov 18 '18 at 16:25






          • 1





            Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

            – Jeff Schaller
            Nov 18 '18 at 16:32


















          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          It's apparent that sdiff attempted to execute a program named exactly emacs -nw, which didn't exist. Your intention was for sdiff to call emacs with an option -nw followed by the file(s).



          The behavior is confirmed by looking at the sdiff source code, where sdiff populates the preferred editor --directly-- into argv[0], which puts the <space><dash>nw together with the emacs. You could also confirm that sdiff is generally working correctly by setting EDITOR=emacs and observing that it opens emacs.



          If you need the option when opening emacs, then my suggestion would be to create a wrapper script:



          $ cat emacs.sh
          #!/bin/sh

          vi "$@"


          Just kidding, of course. You'd use:



          $ cat emacs.sh
          #!/bin/sh

          emacs -nw "$@"


          ... and then set EDITOR=/path/to/that/emacs.sh






          share|improve this answer





















          • 1





            Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

            – filbranden
            Nov 18 '18 at 16:24











          • Small suggestion to use exec when invoking emacs from the script.

            – filbranden
            Nov 18 '18 at 16:25






          • 1





            Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

            – Jeff Schaller
            Nov 18 '18 at 16:32
















          4














          It's apparent that sdiff attempted to execute a program named exactly emacs -nw, which didn't exist. Your intention was for sdiff to call emacs with an option -nw followed by the file(s).



          The behavior is confirmed by looking at the sdiff source code, where sdiff populates the preferred editor --directly-- into argv[0], which puts the <space><dash>nw together with the emacs. You could also confirm that sdiff is generally working correctly by setting EDITOR=emacs and observing that it opens emacs.



          If you need the option when opening emacs, then my suggestion would be to create a wrapper script:



          $ cat emacs.sh
          #!/bin/sh

          vi "$@"


          Just kidding, of course. You'd use:



          $ cat emacs.sh
          #!/bin/sh

          emacs -nw "$@"


          ... and then set EDITOR=/path/to/that/emacs.sh






          share|improve this answer





















          • 1





            Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

            – filbranden
            Nov 18 '18 at 16:24











          • Small suggestion to use exec when invoking emacs from the script.

            – filbranden
            Nov 18 '18 at 16:25






          • 1





            Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

            – Jeff Schaller
            Nov 18 '18 at 16:32














          4












          4








          4







          It's apparent that sdiff attempted to execute a program named exactly emacs -nw, which didn't exist. Your intention was for sdiff to call emacs with an option -nw followed by the file(s).



          The behavior is confirmed by looking at the sdiff source code, where sdiff populates the preferred editor --directly-- into argv[0], which puts the <space><dash>nw together with the emacs. You could also confirm that sdiff is generally working correctly by setting EDITOR=emacs and observing that it opens emacs.



          If you need the option when opening emacs, then my suggestion would be to create a wrapper script:



          $ cat emacs.sh
          #!/bin/sh

          vi "$@"


          Just kidding, of course. You'd use:



          $ cat emacs.sh
          #!/bin/sh

          emacs -nw "$@"


          ... and then set EDITOR=/path/to/that/emacs.sh






          share|improve this answer















          It's apparent that sdiff attempted to execute a program named exactly emacs -nw, which didn't exist. Your intention was for sdiff to call emacs with an option -nw followed by the file(s).



          The behavior is confirmed by looking at the sdiff source code, where sdiff populates the preferred editor --directly-- into argv[0], which puts the <space><dash>nw together with the emacs. You could also confirm that sdiff is generally working correctly by setting EDITOR=emacs and observing that it opens emacs.



          If you need the option when opening emacs, then my suggestion would be to create a wrapper script:



          $ cat emacs.sh
          #!/bin/sh

          vi "$@"


          Just kidding, of course. You'd use:



          $ cat emacs.sh
          #!/bin/sh

          emacs -nw "$@"


          ... and then set EDITOR=/path/to/that/emacs.sh







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 18 '18 at 16:22









          filbranden

          7,80021038




          7,80021038










          answered Nov 18 '18 at 13:56









          Jeff SchallerJeff Schaller

          39.9k1054126




          39.9k1054126








          • 1





            Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

            – filbranden
            Nov 18 '18 at 16:24











          • Small suggestion to use exec when invoking emacs from the script.

            – filbranden
            Nov 18 '18 at 16:25






          • 1





            Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

            – Jeff Schaller
            Nov 18 '18 at 16:32














          • 1





            Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

            – filbranden
            Nov 18 '18 at 16:24











          • Small suggestion to use exec when invoking emacs from the script.

            – filbranden
            Nov 18 '18 at 16:25






          • 1





            Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

            – Jeff Schaller
            Nov 18 '18 at 16:32








          1




          1





          Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

          – filbranden
          Nov 18 '18 at 16:24





          Did you hack my machine??? The former is exactly what emacs.sh has on it!!! 😂😂😂

          – filbranden
          Nov 18 '18 at 16:24













          Small suggestion to use exec when invoking emacs from the script.

          – filbranden
          Nov 18 '18 at 16:25





          Small suggestion to use exec when invoking emacs from the script.

          – filbranden
          Nov 18 '18 at 16:25




          1




          1





          Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

          – Jeff Schaller
          Nov 18 '18 at 16:32





          Indeed, using exec would be a microscopic improvement; one that I noticed only after finding the proposed duplicate. Thanks for the edit!

          – Jeff Schaller
          Nov 18 '18 at 16:32



          Popular posts from this blog

          鏡平學校

          ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

          Why https connections are so slow when debugging (stepping over) in Java?