CPSC 1280 Lecture Notes - Lecture 19: Unix Shell, Root Directory, Grep

87 views2 pages

Document Summary

Wild card with find: wild card expansion shall be interpreted by the shell before command execution, exception with quoting: find command, find supports wild card. [hh][tt][mm][ll] print: all . html and html file in root directory, $ find . ? -print: files with two characters after note in current directory, use double quotation marks to protect the wild card being interpreted. Principle also used by commands in their expressions: grep \. foo looks for a dot in foo. Note the path it takes, when accounting for using certain commands or pipelines during execution. Shell offers the facility of: storing a group of commands in a file and executing the file, called shell scripts, like batch (. bat) files of windows, often use . sh extension, but not mandatory. Ex: $ cat > script. sh directory=/home/ubuntu/document_summarization echo the date today is Mon Dec 10 12:25:15 UTC 2018 echo the current directory is . Bash: script. sh: command not found: $ . /script. sh. Bash: script. sh: permission denied: $ chmod u+x script. sh.

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