Standard input as a plain-text

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input







share|improve this question



















  • Apart from using <, are you concerned about plain text in any particular way? Your question mentions plain text three times.
    – Kusalananda
    May 8 at 16:31














up vote
0
down vote

favorite












how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input







share|improve this question



















  • Apart from using <, are you concerned about plain text in any particular way? Your question mentions plain text three times.
    – Kusalananda
    May 8 at 16:31












up vote
0
down vote

favorite









up vote
0
down vote

favorite











how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input







share|improve this question











how to give standard input --stdin by using < symbol,as a plain text(string) in bash script,
For example i have stored /etc/passwd file by using redirecting > symbol by the same way i want to give plain text as a input









share|improve this question










share|improve this question




share|improve this question









asked May 8 at 15:54









PRAKASH

272




272











  • Apart from using <, are you concerned about plain text in any particular way? Your question mentions plain text three times.
    – Kusalananda
    May 8 at 16:31
















  • Apart from using <, are you concerned about plain text in any particular way? Your question mentions plain text three times.
    – Kusalananda
    May 8 at 16:31















Apart from using <, are you concerned about plain text in any particular way? Your question mentions plain text three times.
– Kusalananda
May 8 at 16:31




Apart from using <, are you concerned about plain text in any particular way? Your question mentions plain text three times.
– Kusalananda
May 8 at 16:31










2 Answers
2






active

oldest

votes

















up vote
1
down vote













Exactly as you describe, with the indirection (<) operator:



/path/to/executable < /path/to/inputfile





share|improve this answer




























    up vote
    1
    down vote













    To redirect from stdin, you don't use < you use |. For example (apologies for the useless use of cat)



    cat /some/file | my_program


    If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<< redirection



    my_program <<< "$my_variable"





    share|improve this answer





















      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',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442584%2fstandard-input-as-a-plain-text%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      Exactly as you describe, with the indirection (<) operator:



      /path/to/executable < /path/to/inputfile





      share|improve this answer

























        up vote
        1
        down vote













        Exactly as you describe, with the indirection (<) operator:



        /path/to/executable < /path/to/inputfile





        share|improve this answer























          up vote
          1
          down vote










          up vote
          1
          down vote









          Exactly as you describe, with the indirection (<) operator:



          /path/to/executable < /path/to/inputfile





          share|improve this answer













          Exactly as you describe, with the indirection (<) operator:



          /path/to/executable < /path/to/inputfile






          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered May 8 at 16:01









          DopeGhoti

          40k54779




          40k54779






















              up vote
              1
              down vote













              To redirect from stdin, you don't use < you use |. For example (apologies for the useless use of cat)



              cat /some/file | my_program


              If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<< redirection



              my_program <<< "$my_variable"





              share|improve this answer

























                up vote
                1
                down vote













                To redirect from stdin, you don't use < you use |. For example (apologies for the useless use of cat)



                cat /some/file | my_program


                If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<< redirection



                my_program <<< "$my_variable"





                share|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  To redirect from stdin, you don't use < you use |. For example (apologies for the useless use of cat)



                  cat /some/file | my_program


                  If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<< redirection



                  my_program <<< "$my_variable"





                  share|improve this answer













                  To redirect from stdin, you don't use < you use |. For example (apologies for the useless use of cat)



                  cat /some/file | my_program


                  If your "stored /etc/passwd file" resides in a variable, and you are not tied to /bin/sh, you can use the <<< redirection



                  my_program <<< "$my_variable"






                  share|improve this answer













                  share|improve this answer



                  share|improve this answer











                  answered May 8 at 16:53









                  glenn jackman

                  45.8k265100




                  45.8k265100






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442584%2fstandard-input-as-a-plain-text%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      w RgDILiDT
                      CFyQ,OJ1MeBEYYj8SQ0X2D YfZrnk cjY 46abBljQVfFvjziSU4iq2q sMO1FD 6Ns,JSeW hXANtmQ8X9BNd5D521xz EPsTYWUM

                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      How many registers does an x86_64 CPU actually have?

                      Displaying single band from multi-band raster using QGIS