Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER THIS IN THE AWK SCRIPTING LANGUAGE. For this part of the assignment, you will create a single command which will take the contents

PLEASE ANSWER THIS IN THE AWK SCRIPTING LANGUAGE.image text in transcribed

For this part of the assignment, you will create a single command which will take the contents of a passwd file (usually found in /etc/passwd) and print it in sorted order by the user's actual name (not username). Normally, you could solve this with the following options on sort $ sort -t k5 /path/to/passwd You, however, must solve this problem with the utilities covered in class so far. You may (and should) use sort, but you may not use any of its options (e.g., -k, -t, etc) Example Input: 1 einstein: x 1539 1543: Albert Einstein: /home/einstein:/bin/bash 2 presley :x: 1540 1544: Elvis Presley :/home/presley:/bin/bash 3 washington: x :1541:1545 George Washington:/home/washington:/bin/bash 4 banner :x: 1542:1546 Bruce Banner:/home/banner /bin/bash 5 harrison:x:1543 1547 George Harrison:/home/harrison:/bin/bash 6 austen:x 1544:1548: Jane Austen:/home/austen:/bin/bash 7 disney : : 1545:1549: Walt Disney : /home/disney:/bin/bash 8 aldrin:x: 1546:1550 Buzz Aldrin:/home/aldrin:/bin/bash 9 curie :x:1547 1551 Marie Curie:/home/curie:/bin/bash 10 tolkien:x: 1548 1552:J. R. R. Tolkien :/home/tolkien:/bin/bash 11 columbus :x 1549 1553: Christopher Columbus: /home/columbus:/bin/bash 12 gogh : x 1550 1554: Vincent Van Gogh:/home/gogh :/bin/bash Output: 1 einstein:x:1539:1543: Albert Einstein: /home/einstein:/bin/bash 2 banner:x 1542:1546: Bruce Banner:/home/banner:/bin/baslh 3 aldrin:x:1546 1550: Buzz Aldrin:/home/aldrin:/bin/bash 4 columbus :x : 1549 1553: Christopher Columbus:/home/columbus :/bin/bash 5 presley:x: 1540 1544: Elvis Presley :/home/presley:/bin/bash 6 harrison:x:1543 1547 George Harrison:/home/harrison :/bin/bash 7 washington : x: 1541:1545 George Washington:/home/washington:/bin/bash 8 austen:x: 1544:1548: Jane Austen:/home/austen:/bin/bash 9 tolkien:x 1548:1552: J. R. R. Tolkien:/home/tolkien:/bin/bash 10 curie:x: 1547 1551: Marie Curie:/home/curie:/bin/bash 11 gogh: x : 1550 1554 Vincent Van Gogh :/home/gogh:/bin/bash 12 disney :x : 1545 1549 Walt Disney:/home/disney:/bin/bash

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

=+j Explain the relationship between unions and MNEs.

Answered: 1 week ago