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 |
What is the default shell of solaris?
Write the syntax for "if" conditionals in linux?
what does "kill -9" and "kill -1" do
How do I set bash as default shell mac?
How do I open a jshell in cmd?
How many fields are present in a crontab file and what does each field specify?
What are the different types of commonly used shells on a typical linux system?
How does shell scripting work?
write a shell script to find the largest number from 3 given numbers.
What does $@ mean in shell?
What are the Different types of shells?
What language is used in terminal?