The objective of this lab is to use basic Unix/Linux commands to manage a simple Java project that includes data files for input and output as well as Java source files. For a passing grade of 6, the project must be built in a single directory, the source and input files created with an editor, the javac and java commands must be demonstrated, and input and output redirection must be demonstrated with a program that reads and writes the standard input and output streams (in Java, System.in and System.out). For full credit of 10, timing and a shell script must be submitted and explained. The lab instructor and your classmates will give further directions and answer questions. Please DO look over each other's work but DON'T SKIP doing all the steps for yourself.
We assume you have "logged in" and have (1) a shell window and (2) a Web browser window open to the Blackboard or your college's course management system assignment submission page.
mkdir to make a new directory.pwd to print the name of the current working directory.cd to (a) go to another directory and verify the change with pwd and (b) go to your home directory with (b1) cd (nothing) and (b2) cd ~ (the tilde charater which means "your home directory"). Verify the two (b)s.ls to view a directory contents and ls -l to see which entries are files versus subdirectories and the sizes, dates, and protections of the files and subdirectories. Files are marked with a (hyphen) - first, and subdirectories are marked with a (letter) d first.pico (or another, like emacs or vi, BUT NOT DrJava) to write the Hello World complete Java application.javac to compile your complete application (ASK HOW)..java file and the .class file..class file with the text editor (DON'T MODIFY IT). Take a look and close it.java to run your complete application. Let's assume your application class (with the main method) is named labDemoApplScanner for the input.)BILLjava labDemoAppl < BILL
What happened?
java labDemoAppl > GNUFILE
What happened? Open GNUFILE with the text editor to see.
java labDemoAppl < BILL > GNUFILE2
What happened? Open GNUFILE2 with the text editor to see.
time java SortingApplication < 27827-8.txt > timedOUTPUT.txt
Try this and report how much time the computer that runs the commands took to run the sorting application on the big file.
#!/bin/sh Make it with a text editor.# or commands to run IN THE FUTURE otherwise.myscriptOne.shchmod command in the form chmod 700 myscriptOne.sh must be given to make the script file become "executable"ls -l command: Observe the -rwx------./myscriptOne.shsort Write a script that automates these steps:
RUN THE SCRIPT. You will get 4 time reports. Compare them. Anything weird? RUN THE SCRIPT A SECOND TIME. Report the 8 times on Blackboard and whatever you make of them.
There has been error in communication with booki server. Not sure right now where is the problem.
You should refresh this page.