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 / 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 |
How to declare functions in unix shell script?
What is inside a seashell?
Explain about sourcing commands?
Why we are writting shell scripts? Plz if possible explain it briefly.
How will you emulate wc –l using awk?
The information of the two files should be redirect to Third file in such a way that, the third file contain the information like this. 1st line in third file should be from 1st file 2nd line in Third file should be from 2nd file 3rd line in Third file should be from 1st file 4th line in Third file should be from 2nd file - - so on
How to create environment variables?What are the conditions for creating variables?
I Forgot My Windows Vista Password! How Can I Find My Windows Lost Password?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
In which variable prompt value is stored?
How do I open the shell prompt?
What is a program shell?