Command Substitution—Two Ways

The example in the “Double Quotes” section containing the syntax `date` is an example of command substitution. Command substitution occurs when a command is included as part of the line of code (such as `date`), and when the line is interpreted, the part of the line containing the embedded command is replaced with the output of the embedded command. Two ways of using command substitution are available. The first way is the way shown earlier in the chapter. This method simply places back tics around the command. The back tics are easily confused with the apostrophes. The apostrophe is near the Enter key on most keyboards, whereas the back tic is found above the Tab key in the upper-left of the keyboard (usually). ...

Get Korn Shell Programming by Example 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.