The Findkey Command
-
findkey <search-patt> <find-opts>fk <search-patt> <find-opts>where:<search-patt>:=<primary-string> [+ <secondary-string>]*<find-opts>:=-key | -k| -exact | -x| -head| -h| -edit| -e
- Searches the chain of databases, comparing the dbrecs and dbrec headers for the given primary string, and displays any matches that it finds, subject to restrictions specified by other options.
- If any secondary strings are specified, restricts matches to those values that also contain those strings as well. The secondary strings can match any other part of the dbrec or header, even if a restriction option is specified.
- If the -key option is specified, only matches dbrecs whose 'key' field contains the primary string.
- If the -exact option is specified, only matches dbrecs whose 'key' field is an exact match to the primary string.
- If the -head option is specified, only matches dbrec headers.
- If the -edit option is specified, invokes the default text editor on the file containing the match. Positions cursor to the line number of the match if the text editor supports it.
-
EXAMPLES:
-
Find any dbrecs or headers containing the string 'google':
-
C:\Users\Myuser>fk google
--------------------------------------------
RECORDS CONTAINING "google":
--------------------------------------------
main:
>2 %_AR_%
"g" -alias "google"
"google" "www.google.com" -url
Note that it not only shows the dbrecs that matched, but includes the dbrec header they are located under.
-
-
Find any dbrecs whose key field contains the string 'g':
-
C:\Users\Myuser>fk g -k
--------------------------------------------
RECORDS CONTAINING "g":
--------------------------------------------
main:
"g" "g:\" -abs -noserv
"g" -alias "google"
"google" "www.google.com" -url
"prog" "%ProgramFiles%"
"say.prog" -execnow echo prog is %prog%
-
-
Find any dbrec headers containing the string 'hyper':
-
C:\Users\Myuser>fk hyper -h
--------------------------------------------
RECORDS CONTAINING "hyper":
--------------------------------------------
main:
>1 %_AR_%
>2 %_AR_%\HyperKey
"hkey" -alias "hyperkey"
"hyperkey" "%HKEYPATH%" ""
>3+ %_AR_%\HyperKey\bat
>3+ %_AR_%\HyperKey\bat
"hkey.bat" "%HKEYPATH%" ""
Note that it not only shows the headers that matched, but includes the set of dbrec headers they are located under, and the first dbrec of any headers that have one under them.
-
-
Find any dbrecs whose key field is an exact match
to the string 'hkey':
-
C:\Users\Myuser>fk hkey -x
--------------------------------------------
RECORDS CONTAINING "hkey":
--------------------------------------------
main:
>2 %_AR_%\HyperKey
"hkey" -alias "hyperkey"
-
-
Open a text editor to the file containing the specific key 'hkey':
-
C:\Users\Myuser>fk hkey -e
--------------------------------------------
RECORDS CONTAINING "hkey":
--------------------------------------------
main:
>6+ X:\Docs\My Docs\Software\Sources\Hyperkey
"hkey" "%__loc%" "" -excl "Versions" -logdiff -lp 1 -logdiffexcl "todo.txt"
arch:
>4 X:\Docs\Archive\System Update Docs\Docs\usr\bin
"hkey" "%binpath%" "" "bat\Hyperkey"
doc:
>4 X:\Docs\Archive\My Docs\Manuals and Documentation
"hkey" "%__loc%" "" "Hyperkey"
This will invoke the text editor on three different database files, 'main', 'arch' and 'doc'. The default text editor is Notepad, which does not support opening to a specific line number. But Hyperkey can be configured to open to a specific line, by modifying batch file 'bat\editfile.bat'.
-
-