Embedding commands

Suppose you create a script that will automatically run when you log in each day. The script might, for example, print "Greetings!" onscreen and possibly deliver a cleaver message: "Say, you're looking sharp today!". You could easily do this with the information you've learned so far in this chapter.

What would be handy here would be to add a line to the script that tells UNIX to do all those things plus name the most recently used file—for those of you who need a reminder about what you were last working on. You could just use an ls command, but that would only list the file names and not integrate the information with the rest of your morning greeting. Instead, a better (and more attractive) idea would be to bundle a couple ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.