CPSC 1280 Lecture Notes - Lecture 18: Unix Shell, Temporary File, Command Substitution

33 views4 pages

Document Summary

Road map: pipe, escaping, quoting, shell variable. Ex: $ who > user. txt, $ wc -l < user. txt. Two disadvantages: for long-running commands, this process can be slow, the second command can"t act unless first one completed, an intermediate file is mandatory, large temporary files can eat up disk spaces in no time. Pipe is the solution to overcome these disadvantages! Examples: replacing redirection, $ who > user. txt ; wc l < user. txt change to, $ who | wc l, working with redirection, $ who | wc l > fkount. Ignorant of source: in some cases, we prefer a command being ignorant of its source and destination, example, $ wc -c *. c beyond_array. c. 940101 total: $ cat *. c | wc -c. $ echo this machine is called ip-172-30-1-227 this machine is called rose: $ date. The date today is sun sep 21 12:50:02 pdt 2015: $ ls Meaning wild card pattern matching redirection pipe command substitution variable.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents