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

136411Re: Search Patterns

Expand Messages
  • Christian Brabandt
    Feb 27, 2013
    • 0 Attachment
      On Wed, February 27, 2013 06:37, John Lusby wrote:
      > Hello,
      >
      > I'm currently trying to read a list of files from a make output and push
      > them into ctags but I'm having trouble with the substitute. I've been
      > using
      > vim to try to get the pattern right but I cant seem to figure it out.
      >
      > I'm currently at the point where my command looks like
      >
      > make telosb verbose 2>&1 >/dev/null | grep 'preprocessing' | sed -e
      > 's/preprocessing//' -e 's/ //' >>somefilenames2.txt
      >
      > but the lines in somefilenames look all garbled
      >
      > Heres a snippet
      >
      > [01;31m [K [m [K/usr/lib/ncc/deputy_nodeputy.h
      > [01;31m [K [m [K/usr/lib/ncc/nesc_nx.h
      > [01;31m [K [m [K/home/john/local/tinyos-2.x/tos/system/tos.h
      > [01;31m [K [m [K/home/john/local/tinyos-2.x/tos/system/TinySchedulerC.nc
      > [01;31m [K [m [K/home/john/local/tinyos-2.x/tos/interfaces/Scheduler.nc
      >
      > I tried using a pattern like :%s/^*\/// to replace it but that just said
      > no
      > pattern ^*\/ found. Does anyone know what I'm doing wrong?
      >
      > Thanks for the help,

      Looks like your make program outputs terminal sequences to e.g. display
      colors? Try explicitly setting your terminal to somthing dumb for make.
      It shouldn't then output those chars:
      TERM=vt100 make ...

      Your pattern doesn't look right btw. I think what you want to search for
      is :%s/^[^/]*//

      Your pattern ^*\/ is actually looking for line start followed by a '*'
      followed by a slash, which is obviously not what you need.

      regards,
      Christian

      --
      --
      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.
    • Show all 5 messages in this topic