Question

In: Computer Science

using lunix or C programming to answer this lab please fill in the blanks with the...

using lunix or C programming to answer this lab please fill in the blanks with the answere being highlighted, so i can understand.

First, type the following command:

            sort employee

What is the order that employee is sorted in? ___________________________________________

Give a brief description of how the file is sorted. _____________________________________________________________________________________________________________________________________________________________________________________________________

Now, sort on the field for last name.

        sort +1 employee

Look at the sorted file. Are all the names sorted in alphabetical order? ______________________

Give a brief description of the output.______________________________________________________________________________________________________________________________________________________________________________________________________________

Sort the file again using the following command:

            sort -f +1 employee

What happens when you sorted it this time? ________________________________________________________________________________________________________________________________________________________________________________________________________

Type in:

            sort +3 employee > hired1

Use the cat command to list out the file hired1 to see the results. Are the hire dates sorted in order? _______________  

If not, what has happened? _____________________________________________________________________________________________________________________________________________

Type in:

            sort -n +3 employee > hired2

What is the result of the sort? _______________________________________________________________________________________________________________________________________________

Type in:

            sort -nb +3.4 employee > hired3

What was the result? ________________________________________________________________________________________________________________________________________________

Briefly explain what happened. ____________________________________________________________________________________________________________________________________________

Type in:

            sort +0 +4n employee

What was the result? ________________________________________________________________________________________________________________________________________________

Were both columns sorted? __________________________

Type in the next command.

            sort +0 -1 +4n employee

What were the results of this output. Was the file sorted on both the department and also the salary field?

Subject

Book Title

Author's

Last Name

Author's

First Name

Pub.

Date

Price

UNIX:

Introduction to UNIX:

Wrightson:

Kate:

2003:

45.00:

UNIX:

Just Enough UNIX:

Anderson:

Paul:

2003:

39.00:

UNIX:

Bulletproof UNIX:

Gottleber:

Timothy

2002:

48.00:

UNIX:

Learning the Korn Shell:

Rosenblatt:

Bill:

1994:

35.95:

UNIX:

A Student's Guide to UNIX:

Hahn:

Harley:

1993:

24.50:

UNIX:

Unix Shells by Example:

Quigley:

Ellie:

1997:

49.95:

UNIX:

UNIX and Shell Programming:

Forouzan:

Behrouz:

2002:

80.00:

UNIX:

UNIX for Programmers and Users:

Glass:

Graham:

1993:

50.00:

SAS:

SAS Software Solutions:

Miron:

Thomas:

1993:

25.95:

SAS:

The Little SAS Book, A Primer:

Delwiche:

Lora:

1998:

35.00:

SAS:

Painless Windows for SAS Users:

Gilmore:

Jodie:

1999:

40.00:

SAS:

Getting Started with SAS Learning:

Smith:

Ashley:

2003:

99.00:

SAS:

The How to for SAS/GRAPH Software:

Miron:

Thomas:

1995:

45.00:

SAS:

The Output Delivery System:

Haworth:

Lauren:

2001:

48.00:

SAS:

Proc Tabulate by Example:

Haworth:

Lauren:

1999:

42.00:

SAS:

SAS Application Programming:

Dilorio:

Frank:

1991:

35.00:

SAS:

Applied Statistics & SAS Programming:

Cody:

Ronald:

1991:

29.50:

issue the command:

        sort -n -t: +4 books

What is the result? ________________________________________________________________________________________________________________________________________________

Try another sort using the books file. Sort on the price field in reverse. Type in the following:

        sort -nr -t: +5 books

What was the result? _______________________________________________________________________________________________________________________________________________

Try one more sort, this time saving the sort to a file. This sort will be on two fields. Put it into a new file called newbooks. Type in:

        sort -t: +0 +1 books > newbooks

Look at the file, newbooks. What does the sorted file look like now?

__________________________________________________________________________________________________________________________________________________________________

Solutions

Expert Solution

1. First, type the following command:

            sort employee

What is the order that employee is sorted in?

ascending order

2. Give a brief description of how the file is sorted.

lines starting with a digit will come before lines starting with a letter. lines starting with a lowercase letter will come before lines starting with same letter but in uppercase.

3. Now, sort on the field for last name.

        sort +1 employee

Look at the sorted file. Are all the names sorted in alphabetical order? Give a brief description of the output.

Yes. But, The output is sorted on the field for last name.

4. Sort the file again using the following command:

            sort -f +1 employee

What happens when you sorted it this time?

Ignore case. Output did not depend on uppercase and lowercase letters.

5. Type in:

            sort +3 employee > hired1

Use the cat command to list out the file hired1 to see the results. Are the hire dates sorted in order? If not, what has happened?

No. employee names stored in the hired1 file with sorted order.

6. Type in:

            sort -n +3 employee > hired2

What is the result of the sort?

Sorted according to numerical value and stored in hired2 file.

Please like the answer and do comment for any queries in any part f the answer.

Happy to help :)


Related Solutions

C++ Fill in the blanks please You are required to fill in the blanks in this...
C++ Fill in the blanks please You are required to fill in the blanks in this program. Consider that: -In main, the variables price and quantity were given the names of p (double) and q (int), respectively. -In the getData function, the parameters associated with the main variables p and q were called pp and pq, respectively. // Prototype: Do not include the names // of the variables in the prototype void getData (FILLTHEBLANK , FILLTHEBLANK); int main () {...
C programming, if you already answer this, please skip, thanks fill in ... /* In this...
C programming, if you already answer this, please skip, thanks fill in ... /* In this program, read stdin a line at a time, and print the longest line. If that line is longer than 30 characters, print it in the format first ten characters...middle ten characters...last ten characters. Note: The longest line can be quite long. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> #define BLOCKSIZE 100 char* readline() {    char* result = NULL;    int rsize;...
please fill in the blanks using c program or lunix with the answers being highlighted 1....
please fill in the blanks using c program or lunix with the answers being highlighted 1. You will now need four files. These are telnos, telnos2, telnos3, telnos4. These files are all short files that contain names, departments, and telephone numbers. This is what they look like. telnos telnos2 Hale Elizabeth Bot   744-6892 Harris Thomas Stat 744-7623 Davis Paulette Phys 744-9579 Cross Joseph   MS    744-0320 Holland Tod    A&S   744-8368 Hale Elizabeth Bot   744-6892 Harris Thomas Stat 744-7623 Davis Paulette Phys...
using Linux please fill in the blanks : telnos files:
  using Linux please fill in the blanks : telnos files: telnos telnos2 Hale Elizabeth Bot   744-6892Harris Thomas Stat 744-7623Davis Paulette Phys 744-9579Cross Joseph   MS    744-0320Holland Tod    A&S   744-8368 Hale Elizabeth Bot   744-6892Harris Thomas Stat 744-7623Davis Paulette Phys 744-9579Holland Tod    A&S   744-8368 telnos3 telnos 4 Hale Elizabeth Bot   744-6892Harris Thomas Stat 744-7623Smith John     Comsc 744-4444Davis Paulette Phys 744-9579Cross Joseph   MS    744-0320Holland Tod    A&S   744-8368 Hale Elizabeth Bot   744-6892Smith John     Comsc 744-4444Davis Paulette Phys 744-9579Cross Joseph   MS    744-0320Holland Tod    A&S   744-8368...
answer all 5 please as this is in steps. 1. Fill in the Blanks A corporation...
answer all 5 please as this is in steps. 1. Fill in the Blanks A corporation has 10,000 bonds outstanding with a 6% annual coupon rate, 8 years to maturity, a $1,000 face value, and a $1,100 market price. MV of debt is The company’s 100,000 shares of preferred stock pay a $3 annual dividend, and sell for $30 per share. Market value of preferred shares is The company’s 500,000 shares of common stock sell for $25 per share and...
Please fill in the 3 blanks in the spreadsheet and then answer the two following question....
Please fill in the 3 blanks in the spreadsheet and then answer the two following question. The following information is from Bluff Run Golf Courses. The company runs three courses and the July income statement for each course is as follows: A. Find the missing value for outings revenue, wages, and operating income. BLUFF RUN GOLF COURSES Income Statement Month Ending July 31, 2018 Blue Course   Black Course   Gold Course   Greens fees revenue    $62,500    $89,000    $42,900   ...
14.6 A- Fill in the Blanks for the required C instructions, and also fill in the...
14.6 A- Fill in the Blanks for the required C instructions, and also fill in the missing comments /******************************************************************* This program outputs 30 kHz square wave on port T, bit-0 using timer channel 0 interrupts and the output compare bit operations. *******************************************************************/ #include <mc9s12c32.h> /* derivative information */ #define HALF_P 133 /* Number clocks per 1/2 period */ /******************************************************************/ void interrupt 8 OC0_isr (void); /******************************************************************/ void main(void) {    /******************************************************************/       /* Initialize I/O */             ___________________ = 1;...
Answer the following questions or fill in the blanks using information contained in the periodic table....
Answer the following questions or fill in the blanks using information contained in the periodic table. a) Boron has properties of both metals and nonmetals and is called a _____________. b) Transition metals are also known as _____-block elements when writing electron configurations. c) Certain nonmental elements like to exist as a pair (H2, F2, etc...) and are called _____________. d) Rows in the periodic table are called _____________. e) Group 18 elements are better known as_______________. f) Iced tea...
Fill-in the blanks of the following table and answer the following questions.
Fill-in the blanks of the following table and answer the following questions.                                Year                         Nominal GDP $                Real GDP $                      GDP Deflator       20052,000, 0002,000,000_____________20062,310,000___________         105Find the GDP Deflator in year 2005.Find the Real GDP in year 2006.Which GPD matters, nominal or real GDP? Why?Did the economy grow in year 2006? Why yes, why not?
Please fill in the blanks (values of A, B, C, D, E, F, G, H, I...
Please fill in the blanks (values of A, B, C, D, E, F, G, H, I , J) for the following financial statements. The firm’s tax rate is 35.3%. Income Statement for Fiscal Year 2015 Sales 2,000 Cost of goods sold 1,500 Gross margin 500 Selling and general expenses 300 Operating income 200 Interest income 5 205 Interest expense 21 Restructuring charges 14 Income before tax 170 Income tax 60 Net income J Balance Sheet, Year 2014 and Year 2015...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT