1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

searching history and regular expressions

Discussion in 'Support' started by covici, Jun 26, 2008.

  1. covici

    Joined:
    Jun 25, 2008
    Messages:
    15
    Likes Received:
    0
    Hi. I have just bought tc 9 and I have a couple of questions.

    What I would like to be able to do is at the command prompt search for a string, but not based at the start of the command to execute -- the lack of this is annoying, but maybe I just don't know how to do it.

    Also, there seem to be options for regular expressions and a detailed description of the syntax, but where can you use then -- my kingdom for an actual manual!

    Thanks.
     
  2. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    If you mean a command in the history, I could not find an automatic
    way, but just pressing the PageUp key and looking through the popup
    list may do what you want. Depending on what you are running the popup
    may begin hidden behind your window, so you may need Alt-Tab to see
    it.

    You might try something like one of these, then use copy/paste to re-run it:
    *history | *ffind /k /m /v /t"string"
    *history | *ffind /k /m /v /e"expression"

    The new TCMD has a Command Input pane that may also help you do what you want.


    If you can use a pattern (e.g. *.txt) then you can also use a regular
    expression (e.g. with perl, ::.*\.txt). Just put the double colon ::
    prefix and then the expression.

    Type HELP WILDCARDS and the bottom of that page has this information.

    --
    2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Saturday.
    Measure wealth by the things you have for which you would not take money.
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,863
    Likes Received:
    83
    covici wrote:

    Not sure what you're looking for here -- do you want to search the
    history list or the screen buffer?


    You use them (almost) anywhere you'd use a wildcard filename. (The
    online help documents which commands and variable functions support
    wildcards.)

    Rex Conn
    JP Software
     
  4. covici

    Joined:
    Jun 25, 2008
    Messages:
    15
    Likes Received:
    0
     
  5. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,190
    Likes Received:
    11
    If the desire is to recall a previous command so that you can execute it
    again, just type a few letters of the command and press the up/down arrow
    keys. You will cycle through previous commands that begin with those
    letters. The more letters you type the tighter the filter becomes. No
    letters cycles through all the command history.

    -Scott

    Jim Cook <> wrote on 06/26/2008 11:36:37 AM:


    a

    lack of

    it:

    want.


    money.
     
  6. Jim Cook

    Joined:
    May 20, 2008
    Messages:
    604
    Likes Received:
    0
    In my reading from the OP, the desire was to match not the _first_ few
    letters of a command, but a few letters from the _middle_ of a command
    string.

    --
    2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
    Next year they're Saturday.
    Measure wealth by the things you have for which you would not take money.
     

Share This Page