============================== Unix Lab 7 (AWK and scripting) ============================== - Prepared by Ian Allen - idallen@ncf.ca Complete as much of this lab as you can. At the end of the lab, hand the instructor a piece of paper giving the absolute pathname of the highest script file you created. The instructor may copy your file for inspection after class. (Make sure he can read it!) 1) Use Unix commands to create an output data file named "last.txt" consisting of the first, fifth, and ninth columns of the first 200 lines of output of the Unix "last" command. (Just columns 1, 5, and 9.) The resulting file will be 200 lines long and will have three columns. 2) Write a script containing a commmand line that will read your output file, last.txt, and produce the three columns from that file in the order 2, 1, 3. Name this executable script "planA.sh". 3) Copy the working planA.sh script to "planB.sh". Modify planB.sh to read standard input instead of reading the last.txt file. Try your planB.sh script using standard input from various things, such as your last.txt file, the output of the "who" command, the output of "ls -l", etc. Your planB.sh file should re-arrange the columns of any text coming in on standard input so that the columns come out in the order 2, 1, 3: $ who | ./planB.sh [...output here...] $ ls -l | ./planB.sh [...output here...] $ cat last.txt | ./planB.sh [...output here...] $ ./planB.sh