Any MPE users who need to know how to invoke grep — a Unix mainstay for searching lines — on their 3000 will see important differences between MPE and Unix. While discussing how to invoke grep from the 3000’s CI, the answer (RUN FINDTEXT.NMPRG.CSLXL) leads to a discussion of using the powerful rm command, and a note about how un-reversible its effects are.
“You need to run grep from the shell if you want to use wildcards,” says 3000 programmer Greg Stigers. “Unlike most every other operating system, Unix does not let the utility expand wildcards itself. The shell expands the wildcarded argument to a list of files that it then passes to the utility. This is why rm cannot ask you if really, truly mean to delete every single file (a la DOS’s infamous ‘Are you sure?’).”
He adds, “Likewise, if you want to grep wildcards, you have to invoke the shell. The only apparent exception I can immediately think of is listing every file in a directory. But that does not in fact require a wildcard per se.”
Peter Smithson puts tongue in cheek to comment on Unix’s inability to expand wildcards. “What an odd way to put it — you make it sound like a disadvantage!” he says. ”Usually the problem is that Unix doesn’t do much for you. You might say the shell Unix expands all the arguments for you, so that each utility doesn’t need wildcard code in it.
“You can turn off wild card expansion in the shell. That will allow you to write a utility that does its own wildcard expansion. But you can do this only if you know in advance and turn off the feature, so it’s not that handy. Or you could write your own shell.”