Code covered by the BSD License  

Highlights from
hs: a pedestrian history search engine

5.0

5.0 | 6 ratings Rate this file 3 Downloads (last 30 days) File Size: 9.12 KB File ID: #20610
image thumbnail

hs: a pedestrian history search engine

by us

 

08 Jul 2008 (Updated 21 Apr 2009)

hs searches the command history for patterns

| Watch this File

File Information
Description

HS searches the command history file for entries containing a specific pattern using the regular expression engine.
the results are displayed in the command window in the format:

#entry location: line

clicking the -location- will open the history file at this line;
clicking the -line- will copy/paste the line to the command prompt and may be return by an [ENTER] command.

see:

>> help hs

for more explanations for this snippet

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
find, regexp, regular expression, strfind, string
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (11)
12 Apr 2011 Matt Bauman  
12 Apr 2011 Matt Bauman

This is great! Thanks for the submission. One small fix for this to work on Mac:

Change the function GREP_copypaste (line 1168) to

import java.lang.*
import java.awt.*;
import java.awt.event.*;
clipboard('copy',s);
rob=Robot;
if ismac
modifier = KeyEvent.VK_META;
else
modifier = KeyEvent.VK_CONTROL;
end
rob.keyPress(modifier);
rob.keyPress(KeyEvent.VK_V);
rob.keyRelease(modifier);

21 Apr 2009 Yuri Kotliarov

Works as expected. Great tool! I believe it should be part of Matlab. Thanks a lot!

16 Apr 2009 Yuri Kotliarov

I downloaded the file and unzipped it into directory in matlab path. Tried to restart matlab. This error always pops up. I can see grep function nested in hs.m and I can see this line at the end. But I don't have grep.m ('which grep' returns 'not found'.) Looks like I need it but hs documentation does not say it.

16 Apr 2009 us

yuri, i do not understand this error - GREP is embedded into HS...
if you
type hs
you should see this line at the end (-2 two lines)

%$SSC_INSERT_END 29-Aug-2008/17:29:29 F:/usr/matlab/unix/grep.m

can you give more information...
urs

15 Apr 2009 Yuri Kotliarov

When clicking on a line I get error:
??? Undefined function or method 'grep' for input arguments of type 'double'. Matlab 2008a.

04 Mar 2009 Kenneth Eaton  
03 Mar 2009 John D'Errico

It does what it claims to do, and does so well.

01 Aug 2008 Thierry Dalon

Look great!
I would remove all history entries coming from hs itself. there are not very useful.

27 Jul 2008 Urs (us) Schwarz

dear WS - because at work (a hospital), i'm living behind two(!) firewalls, which wont let me upload anything else than a zip attachment...
sorry for the inconvenience
us

25 Jul 2008 w s

Why do you put a single m-file in a zip-file? Yet, great tool!

Updates
29 Aug 2008

changed line-click from rerun to copy/paste to the command prompt; version tag 29-Aug-2008 17:28:54

21 Apr 2009

Yuri Kotliarov has disclosed a strange behavior, which was corrected; thanks, Yuri!
version tag: 21-Apr-2009 21:38:10

Contact us