searching history and regular expressions

Jun 25, 2008
15
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.
 
May 20, 2008
603
0
Sammamish, WA
> 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
12,340
149
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,495
16
Solon, OH, USA
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.
 
May 20, 2008
603
0
Sammamish, WA
> 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.
 
Similar threads
Thread starter Title Forum Replies Date
J History file load hangs if file has complete garbage in it... Support 1
R History window wrong size, can't remember size change Support 12
T How to? retain command history across reboot? Support 6
nikbackm Speeding up the history dialog Support 6
D ParentDirectory does not update directory history Support 6
vefatica Command history search is off Support 7
D Directory History Window with wildcard search Support 3
R Long commands retrieved from command history have blank line when wrapped Support 20
Joe Caverly @HISTORY issues Support 4
vefatica Deleting entries in the command history popup? Support 3
H History and TPipe Oddness Support 3
D History and control-C Support 1
G Console exe up / down history Support 8
D What does the file "..\Everything\Run history.csv" store? Support 5
rps Cmd history recall Support 4
David McClelland Command history loosing entries Support 18
R history features. Support 6
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
M Ctrl-C when using command line history does nothing Support 2
S Debugger Bat file call history Support 9
Charles Dye Ctrl-Shift-Up doesn't update directory history Support 1
vefatica ESC after recalling a command from history Support 3
T TCHelp executable history? Support 2
thorntonpg @blahblah added to history. Support 0
M Call History popup-window? Support 0
M HISTORY lessons ... Support 0
vefatica The help and IE's history Support 16
D Towards shared (dir-)history lists Support 3
vefatica Ctrl-Enter in command history window? Support 8
vefatica History recall turns off Quick-Edit Support 4
C history is getting deleted under unknown circumstances Support 9
R V19 - At startup, TCC save directory in the directory history list Support 2
T [TCC 18] Can't read nor write history Support 1
I Possible Bug: History /n Returns Nothing Support 3
jbanaszczyk Lost history Support 4
T history.sav Support 4
T How to? sort history in tcexit.btm Support 22
vefatica OT: Windows console history? Support 7
S directory history locks up TCC Support 3
R In addition to ALIAS /Z and FUNCTION /Z, HISTORY /Z? Support 1
E TCC History popups too small Support 0
C How to? Keeping all history lists Support 4
E Command History not showing on up arrow button Support 8
nikbackm HISTORY /R1 performance Support 3
T Selecting line from popup history without executing Support 8
A How to? Filter history list with unicode chars Support 0
vefatica WAD HISTORY /R, No closing quote? Support 10
vefatica WAD DO /S ... all dirs wind up in the history! Support 12
D Dir History file check Support 18
ehab aboudaya How to? Command Input history for each tab? Support 0

Similar threads