searching history and regular expressions

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 25, 2008
15
0
#1
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
> 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.
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.


> Also, there seem to be options for regular expressions and a detailed
> description of the syntax, but where can you use them
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.
 

rconn

Administrator
Staff member
May 14, 2008
10,160
86
#3
covici wrote:

> 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.
Not sure what you're looking for here -- do you want to search the
history list or the screen buffer?


> 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!
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
 

samintz

Scott Mintz
May 20, 2008
1,228
11
Solon, OH, USA
#5
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:


> Quote:
>
> > 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.
>
> 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 whatyou
want.


> Quote:
>
> > Also, there seem to be options for regular expressions and a detailed
> > description of the syntax, but where can you use them
>
> 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.
 
#6
> 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
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.