ryanamannion / logutil

script to create a new log file and open it for editing
1 stars 0 forks source link

Quick open after grep #4

Open ryanamannion opened 3 years ago

ryanamannion commented 3 years ago

After you grep for a pattern with -s, it might be handy to output the search results with numbers, and allow -o to quick open one of those logs with e.g.:

$ logutil -s importan
0    2021-07-12.txt:    Feature importance
1    2021-07-12.txt:    feature importance, and a couple of the features I thought would be most
2    2021-07-12.txt:    important are, so that was good to see.
3    2021-07-09.txt:    [ ] Feature importance
4    2021-07-13.txt:    importance for the model which was really interesting to see.
$ logutil -o 3
# is equivalent to 
$ logutil -o 2021-07-09
ryanamannion commented 3 years ago

pipe grep output to nl to number lines