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 command needs to be used to take the backup?
what does "kill -9" and "kill -1" do
What are the advantages of shell scripting?
What is the best shell scripting language?
Is it possible to substitute "ls" command in the place of "echo" command?
Write down the syntax for all the loops in shell scripting.
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?
What are different types of shell?
What is the first line of a shell script called?
How will you print the login names of all users on a system?
What are the advantages of using shell scripts?
What does $@ mean in shell?