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 command to find out today's date?
What is shell application?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
How to initialize a directory size to a variable??
c program to display the information of given file similar to givan by the unix or linux command ls -l
How to print all array elements and their respective indexes?
What does path stand for?
wats the she bang statment with syntax?
What is shell variable?
Why is shell scripting important?
What is a shell made of?
What is Linux language details