The self-contained phone directory
The self-contained phone directory
Answer
#!/bin/sh grep -i "$1" << PHONES Ada Lovelace 403-555-0142 Grace Hopper 780-555-0199 Ken Thompson 604-555-0170 PHONES
The data is the standard input of grep. Nothing outside the script is opened, so there is no second file to ship or to lose.
S&K 3e ch13 §13.3; here-document rules from POSIX.1-2024 §2.7.4