There is a record with fields namely name,roll
no.,salary,grade etc.Now,write a script to create a file
with multiple records have same combination of fields but
with unique roll numbers.The script should work for
different names in the input file.
Answer Posted / sabhapathi
Don't mind my answer is lengthy....
Let file name be employee
name, rollno., salary, grade
cut each of records in each field to temp files as follows:
-----------------------------------------------------------
cut -f1 employee > /sm.tmp.$$
cut -f2 employee > /sn.tmp.$$
cut -f3 employee > /so.tmp.$$
cut -f4 employee > /sp.tmp.$$
Paste them as required in to another file as follows
----------------------------------------------------
paste /sn.tmp.$$ /sm.tmp.$$
paste /sn.tmp.$$ /so.tmp.$$
paste /sn.tmp.$$ /sp.tmp.$$
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Why is a script important?
what is info area how many types?
What is wc in shell script?
What is bourne shell scripting?
wats the deinitions for shell utility and filter?
What makes c shell a more preferable option than the bourne shell?
Please give me example of " at command , contrab command " how to use
What is shell and terminal?
What is gui scripting?
Explain about sourcing commands?
What is meant by dos operating system?
Is shell scripting a language?
What is scripting used for?
Can you write a script to portray how set –x works?
What is mac default shell?