Week 5, Intro to Unix lab 2016
Content
sort, uniq, nl, sed, grep
- regular expressions
Homework
Write Basic Regular Expressions (BRE) describing following strings:
- A row in
/etc/passwd
file containing in 5th column text, which is formatted as Name Surname. It means that 5th column begins with capital letter, is followed by lowercase letters and later space, capital letter again and again lowercase letters. - A row, which contains (probably) a date formatted like
25.8.1998
. We accept “days” and “month” in in range 0-99. We do no care that there is at maximum 30 days and 12 months.- Positive examples which will match the regular expressions:
Ahoj, sejdeme se 5.2.2010 po Unixu.
Neslo by to spis 35.5.1900?
- Negative examples which won’t match the regular expressions:
Budu tam 234.42.2010.
Babicka prijde na navstevu v patek 4.2.20000. Prijdu 23.356.2011.
Muzes na fotbal 4.2.?
- Positive examples which will match the regular expressions:
Bonus
- NEW - (1 point) - presentation for
diff
andcomm
commands