This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Sort list2 into list2.srt % sort list2> list2.srt Merge the two sorted files into list3 % sort -m list1.srt list2.srt> list3 Is list3 sorted? (Don't look at it. Use a command to check the file.) % sort -c list3 Yes it is sorted Try to merge the unsorted files? What happens? % sort -m list1 list2> list4 The result list4 is not sorted. 4. Add some more lines to the file names.dat, duplicating several last names and numbers. Sort the names.dat file using the second number as your primary key, the last name as your secondary key, and the first number as your ternary key. Do it using both the new and the old syntax. Show the command you used: New way: sort -k 5rn,5 -k 3b,3 -k 4rn,4 names.dat Old way: sort +4rn -5 +2b -3 +3rn -4 names.dat...
View Full Document
This note was uploaded on 02/01/2010 for the course CS 072 taught by Professor Reneea.fecteau during the Spring '03 term at San Jose State University .
- Spring '03