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 significance of $#?
If one dont know how to create a script then how he/she can use the QTP?
I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?
In shell scripting if text is surrounded by single quotes what does it denotes?
What is the crontab?
How do you schedule a command to run at 4:00 every morning?
What is the use of a shebang line?
What are the different kinds of loops available in shell script?
What is shell geeksforgeeks?
How do I stop script errors?
How to make userdefined variables to available for all other shells?
What is the syntax of "nested if statement" in shell scripting?