For this exercise you will need to know how to use a text editor like pico, vi or emacs. In addition, you will need to know the following commands:
UNIX Commands | Humdrum Commands |
---|---|
grep | ls |
grep -h | wc |
Change directories /var/share/Humdrum/Music824/Scores and find the directory containing Ojibway songs. These songs were collected by Frances Densmore between 1907 and 1909. Answer the following questions.
COMMAND: ls ojib*.krn | wcNote that the "ls" command behaves differently depending on whether or not its output is "piped" to another process. When "ls" is not piped, it formats the list of files with several files on each output line -- so it is easier to see all of the files in a directory on the computer display. However, when piped, "ls" generates a single column list of files (in alphabetical order) so each line of output contains a single filename. This allows commands like "wc" to be able to count the files as "the number of lines". In order to see the difference, compare the command "ls" with the command "ls | more".
ANSWER: 370 songs files
COMMAND: grep '\*Ifeme' ojib*.krn | wc
COMMAND: grep '\*Imale' ojib*.krn | wc
ANSWER:
COMMAND: grep -h '!!MPN:' ojib*.krn | sort | uniq -c | sort -n
ANSWER: E'niwub'e
COMMAND: grep -h '!! Drum-rhythm:' ojib*.krn | sort | uniq
ANSWER: Eleven drum patterns are present.
COMMAND: grep -h '!! Drum-rhythm:' ojib*.krn | sort | uniq -c
ANSWER: Two patterns are tied for first place.
(12^ 12r 12 12^ 12r 12)
(8 8 8 8 8 8)