It's hard to understand what you're asking for. You need to be careful about using $read without the -nt switches, as you can cause a line containing the text $version be replaced by the result of that identifier.

If you are wanting to find out how many lines of a text file is exactly a known word:

//filter -fw versions.txt @test word | echo -a $filtered

Number of lines containing a string:

//filter -fw versions.txt @test *word* | echo -a $filtered

(Note this finds password and sword)

Number of lines beginning with a word and a space and other words:

//filter -fw versions.txt @test word * | echo -a $filtered

If you want to scan a file for whichever is the most common line, you could make a hash table or @window to contain each word found, along with a counter of how many times that word/line appears.

edit: instead of creating a junk @window for the output, you can use the bit-bucket $null alias:

//filter -fk versions.txt null word | echo -a $filtered

Last edited by maroon; 22/10/17 12:24 AM.