Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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.



There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a..

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

Post New Answer

More Shell Script Interview Questions

What is the default shell of solaris?

0 Answers  


Write the syntax for "if" conditionals in linux?

0 Answers  


what does "kill -9" and "kill -1" do

2 Answers   Amazon,


How do I set bash as default shell mac?

0 Answers  


How do I open a jshell in cmd?

0 Answers  


How many fields are present in a crontab file and what does each field specify?

0 Answers  


What are the different types of commonly used shells on a typical linux system?

0 Answers  


How does shell scripting work?

0 Answers  


write a shell script to find the largest number from 3 given numbers.

6 Answers  


What does $@ mean in shell?

0 Answers  


What are the Different types of shells?

5 Answers  


What language is used in terminal?

0 Answers  


Categories