# SD212 HW 12

## [name] Type your name on the next line


## [Q1]
> Did you read the required reading, ["Editing on the fly" from TLCL chapter 20][tlcl-edit]?

> (Answer "yes" if you did.)



## [Q2]
> Which of these commands would remove empty items from a
> comma-separated list, like turning "`blue,green,,,orange,,yellow`"
> into "`blue,green,orange,yellow`"?

> (a) `tr ',,' ','`
> (b) `tr -d ',,'`
> (c) `tr -s ','`
> (d) `tr -e ',,' ','`

> (Enter just the letter of the correct choice.)



## [Q3]
> What does the following command do?

>     sed 's/\([0-9]\{2\}\)\/\([0-9]\{2\}\)\/\([0-9]\{4\}\)$/\3-\1-\2/'

> (a) Changes dates like `02/01/2023` to `2023-02-01`
> (b) Changes phone numbers like `(302) 555.0417` to `302-555-0417`
> (b) Performs long division by doing repeated subtractions
> (d) This question is impossible for mortal humans to answer



## [Q4]
> Which of these commands would shorten long proper nouns to their
> first three letters, like `Delaware` would become `Del.` and
> `Midshipman` would become `Mid.`?

> (a) `sed -E '/\b[A-Z]\w\w(\w*)/d'`
> (b) `sed -E 's/\b[A-Z]\w\w(\w*)/\1/./'`
> (c) `sed -E 'y/[A-Z]\w\w\w*/[A-Z]\w\w./'`
> (d) `sed -E 's/\b([A-Z]\w\w)\w*/\1./'`




