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 are the additional egrep symbols?
Is shell scripting a programming language?
What makes c shell a more preferable option than the bourne shell?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
What does $0 mean in shell script?
How to open a read-only file in the shell?
What is the significance of the shebang line in shell scripting?
what are bootlevel in linux?which level is booting by default.
Explain about non-login shell files?
Is bash an operating system?
what do u mean by $#,$* in unix programming?
What is the first line in a shell script?