cat grepq
test $# -ge 1||
exec echo usage: $0 PATTERN \[FILE\]
# count lines until PATTERN
__=$(exec sed -n '/'"$1"'/!d;=;q' $2);
# no of lines
exec test ${#__} -gt 0;
For example, grepq '93.184.216.34 example.com' /etc/hosts||
echo 93.184.216.34 example.com >> /etc/hosts
One of the very early OReilly books has a chapter or two about sed that tries to describe it using an analogy to a scrivener in a monastary. Quite amusing. This is not the "sed and awk" book. It was an earlier book on text editing with UNIX. It may have been co-authored by OReilly himself; I cannot remember.
IME, most websites work great without JS. Others require a little work to get to the data. And very, very few are comletely non-functional without JS.
Personally, I am inclined to agree with you that the number of folks turning JS off is small. Otherwise methinks developers would make more websites completely non-functional without JS to compel users to use JS. Thankfully, they do not.
As for Pascal, the question is: Is Pascal a better language for teaching programming than Java or Python? At one time Pascal was very popular for this purpose.