-file.txt-
some text here
more
The 's' switch returns whatever follows the string
$read(file.txt,s,some) would return "text here"
$read(file.txt,s,more) would return $null
The 'w' switch will match a single word on a line
$read(file.txt,w,more) would return "more"
if !$read(file.txt,w,$2) { write file.txt $2 | echo -s saved $2 }