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 |
how will you find the total disk space used by a specific user?
How does ls command work?
wats the deinitions for shell utility and filter?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
How do I stop script errors?
What can you do with powershell?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
Is shell and terminal the same?
In a single command how do you run the previous command in the command prompt.
How to write a function?
How do I run a bin bash script?
write a shell program to check wheather a given string is pallindrome or not?