Loading ...
Sorry, an error occurred while loading the content.

How to echo to stdout?

Expand Messages
  • Peng Yu
    Hi, The following command does not echo anything to stdout. ~/linux/bin/xplat/src/vim/vimS/main$ cat main.vimrc ... ~/linux/bin/xplat/src/vim/vimS/main$ vim -S
    Message 1 of 7 , Jun 1, 2013
    • 0 Attachment
      Hi,

      The following command does not echo anything to stdout.

      ~/linux/bin/xplat/src/vim/vimS/main$ cat main.vimrc
      :echo "Hello world"
      :q
      ~/linux/bin/xplat/src/vim/vimS/main$ vim -S main.vimrc

      Is there a way to echo the message to stdout? Also what is the fd
      number that echo print to by default and how it implement in vim?
      Thanks.

      Regard,
      Peng

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Asis Hallab
      Hi there! ... You do need the exclamation mark. Cheers! ... -- Asis Hallab Rothehausstr. 6 - 12 50823 Köln Skype: asis.hallab.cgn Fest (Köln) 42346046 Mobil
      Message 2 of 7 , Jun 1, 2013
      • 0 Attachment
        Hi there!

        2013/6/2 Peng Yu <pengyu.ut@...>:
        > Hi,
        >
        > The following command does not echo anything to stdout.
        >
        > ~/linux/bin/xplat/src/vim/vimS/main$ cat main.vimrc
        > :echo "Hello world"

        :!echo "Hello world!

        You do need the exclamation mark.

        Cheers!

        > :q
        > ~/linux/bin/xplat/src/vim/vimS/main$ vim -S main.vimrc
        >
        > Is there a way to echo the message to stdout? Also what is the fd
        > number that echo print to by default and how it implement in vim?
        > Thanks.
        >
        > Regard,
        > Peng
        >
        > --
        > --
        > You received this message from the "vim_use" maillist.
        > Do not top-post! Type your reply below the text you are replying to.
        > For more information, visit http://www.vim.org/maillist.php
        >
        > ---
        > You received this message because you are subscribed to the Google Groups "vim_use" group.
        > To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        > For more options, visit https://groups.google.com/groups/opt_out.
        >
        >



        --
        Asis Hallab
        Rothehausstr. 6 - 12
        50823 Köln

        Skype: asis.hallab.cgn
        Fest (Köln) 42346046
        Mobil (O2) 0176 63370211
        Fax 01212 - 5 - 30697106

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Peng Yu
        That is not what I m looking for. I need to somehow redirect that output that is not to stdout to stdout. For example, I want to see the output of set
        Message 3 of 7 , Jun 2, 2013
        • 0 Attachment
          That is not what I'm looking for. I need to somehow redirect that
          output that is not to stdout to stdout.

          For example, I want to see the output of "set filetype" on stdout.

          ~/linux/test/vim/man/variable/filetype$ cat main.vimrc
          set filetype
          q
          ~/linux/test/vim/man/variable/filetype$ vim -S main.vimrc

          On Sun, Jun 2, 2013 at 1:03 AM, Asis Hallab <asis.hallab@...> wrote:
          > Hi there!
          >
          > 2013/6/2 Peng Yu <pengyu.ut@...>:
          >> Hi,
          >>
          >> The following command does not echo anything to stdout.
          >>
          >> ~/linux/bin/xplat/src/vim/vimS/main$ cat main.vimrc
          >> :echo "Hello world"
          >
          > :!echo "Hello world!
          >
          > You do need the exclamation mark.
          >
          > Cheers!
          >
          >> :q
          >> ~/linux/bin/xplat/src/vim/vimS/main$ vim -S main.vimrc
          >>
          >> Is there a way to echo the message to stdout? Also what is the fd
          >> number that echo print to by default and how it implement in vim?
          >> Thanks.
          >>
          >> Regard,
          >> Peng
          >>
          >> --
          >> --
          >> You received this message from the "vim_use" maillist.
          >> Do not top-post! Type your reply below the text you are replying to.
          >> For more information, visit http://www.vim.org/maillist.php
          >>
          >> ---
          >> You received this message because you are subscribed to the Google Groups "vim_use" group.
          >> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          >> For more options, visit https://groups.google.com/groups/opt_out.
          >>
          >>
          >
          >
          >
          > --
          > Asis Hallab
          > Rothehausstr. 6 - 12
          > 50823 Köln
          >
          > Skype: asis.hallab.cgn
          > Fest (Köln) 42346046
          > Mobil (O2) 0176 63370211
          > Fax 01212 - 5 - 30697106
          >
          > --
          > --
          > You received this message from the "vim_use" maillist.
          > Do not top-post! Type your reply below the text you are replying to.
          > For more information, visit http://www.vim.org/maillist.php
          >
          > ---
          > You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
          > To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/EI3U_GbYCKg/unsubscribe?hl=en.
          > To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@....
          > For more options, visit https://groups.google.com/groups/opt_out.
          >
          >



          --
          Regards,
          Peng

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Christian Brabandt
          Hi Peng! ... #v+ ~$ cat main.vimrc set t_ti= t_te= echo Hello world q ~$ vim -S main.vimrc Hello world ~$ #v- Alternatively, tell vim you are using a dumb
          Message 4 of 7 , Jun 2, 2013
          • 0 Attachment
            Hi Peng!

            On Sa, 01 Jun 2013, Peng Yu wrote:

            > Hi,
            >
            > The following command does not echo anything to stdout.
            >
            > ~/linux/bin/xplat/src/vim/vimS/main$ cat main.vimrc
            > :echo "Hello world"
            > :q
            > ~/linux/bin/xplat/src/vim/vimS/main$ vim -S main.vimrc

            :h xterm-screens

            #v+
            ~$ cat main.vimrc set t_ti= t_te=
            echo "Hello world"
            q
            ~$ vim -S main.vimrc
            Hello world
            ~$
            #v-

            Alternatively, tell vim you are using a dumb terminal (then you don't
            need to reset t_ti and t_te):

            #v+
            ~$ TERM=dumb vim -S main.vimrc

            Hello world
            ~$
            #v-

            regards,
            Christian
            --
            Es gibt Tiere, die kein Fleisch fressen, z.B. unsere Kühe. Wenn wir
            das Experiment machen könnten, eine Ochsenherde mit Fleisch zu
            füttern, so würden die Ochsen verrückt.
            -- Rudolf Steiner

            --
            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Peng Yu
            ... I m not sure what you meant here. Did you mean the following? vim -c set t_ti= t_te= -S main.vimrc But then I see many empty lines (more than a screen)
            Message 5 of 7 , Jun 2, 2013
            • 0 Attachment
              > #v+
              > ~$ cat main.vimrc set t_ti= t_te=
              > echo "Hello world"
              > q
              > ~$ vim -S main.vimrc
              > Hello world
              > ~$
              > #v-

              I'm not sure what you meant here. Did you mean the following?

              vim -c 'set t_ti= t_te=' -S main.vimrc

              But then I see many empty lines (more than a screen) printed before
              "Hello World" is printed.

              --
              Regards,
              Peng

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Christian Brabandt
              Hi Peng! ... The email got messed up. ... Yes of course, because Vim draws a screen when starting. Try using the dumb terminal as I have show. This seems to
              Message 6 of 7 , Jun 2, 2013
              • 0 Attachment
                Hi Peng!

                On So, 02 Jun 2013, Peng Yu wrote:

                > > #v+
                > > ~$ cat main.vimrc set t_ti= t_te=
                > > echo "Hello world"
                > > q
                > > ~$ vim -S main.vimrc
                > > Hello world
                > > ~$
                > > #v-
                >
                > I'm not sure what you meant here. Did you mean the following?
                >
                > vim -c 'set t_ti= t_te=' -S main.vimrc

                The email got messed up.

                > But then I see many empty lines (more than a screen) printed before
                > "Hello World" is printed.

                Yes of course, because Vim draws a screen when starting. Try using the
                dumb terminal as I have show. This seems to work.


                regards,
                Christian
                --
                Bürokommunikation? Schreibtischgelaber!

                --
                --
                You received this message from the "vim_use" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • John Little
                ... How about: $ cat main.vimrc redir! /tmp/main.out echo hello set ft? echo redir END q $ vim -S main.vimrc $ cat /tmp/main.out Regards, John Little --
                Message 7 of 7 , Jun 2, 2013
                • 0 Attachment
                  On Sunday, June 2, 2013 11:29:04 PM UTC+12, Peng Yu wrote:
                  > That is not what I'm looking for. I need to somehow redirect that
                  > output that is not to stdout to stdout.
                  >
                  > For example, I want to see the output of "set filetype" on stdout.

                  How about:

                  $ cat main.vimrc
                  redir! > /tmp/main.out
                  echo "hello"
                  set ft?
                  echo ""
                  redir END
                  q
                  $ vim -S main.vimrc
                  $ cat /tmp/main.out

                  Regards, John Little

                  --
                  --
                  You received this message from the "vim_use" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                Your message has been successfully submitted and would be delivered to recipients shortly.