I'm currently working on trying to merge two files together on unix and I REALLY need help. I'm very new to Unix (and this site) and would appreciate any assistance. first file:Tom 313.455.6786Deena 313.899.7400Will 313.845.5633Nancy 313.676.9445Kelly 313.611.4242John 313.908.3858second file:Deena TuesdayWill MondayKelly SundayJohn WednesdayTom ThursdayNancy SaturdayI'm writing the script in the korn shell and I need to include for loops and arrays and all that jazz. This is what I have so far:#!/bin/kshfile1=/home/file1file2=/home/file2set -A nameset -A phoneset -A dayfor input in `cat file1| cut -d   -f1`        do        name=$inputdonefor input2 in `cat file1|cut -d   -f2`        do        phone=$input2done    for input3 in `cat file2|cut -d   -f2`            do day=$input3            week= Monday Tuesday Wednesday Thursday Friday Saturday Sunday            for day in $week            do            echo $day\n            day=$i            done    done    printf %s\t%-12s\t%s\n Name On-Call Phone; join < (sort file1) <    (sort file2) | tr ' ' '\t'This scipt is giving me the following output:Name    On-Call        PhoneDeena   313.899.7400   TuesdayJohn    313.908.3858   WednesdayKelly   313.611.4242   SundayNancy   313.676.9445   SaturdayTom     313.455.6786   ThursdayWill    313.845.56334  MondayThat code sorted the files by alphabetizing the names, rather than by the weekdays, which is what I need. Also it's reversing the On-call output with the Phone output. I need the final file to look exactly like thisName    On-Call    PhoneWill    Monday     313.845.5633Deena   Tuesday    313.899.7400John    Wednesday  313.908.3858 Tom     Thursday   313.455.6786  Nobody  Friday     313.555.3454   Nancy   Saturday   313.676.9445 Kelly   Sunday     313.611.4242Can anyone help?
How to create a script that merges two files to get a specific output in the korn shell?
shell script;ksh;merge