Command | Explanation |
---|---|
cat | Prints the entire file to the screen. This is mostly useful for short files |
less | Prints the file to the screen, one "page" at a time where are page is the amount of stuff that will fit onto your terminal window. To advance to the next page, hit the spacebar. To go back a page, hit 'b'. To quit, hit 'q' |
To start an ssh session, open a terminal on your laptop
ssh UNIX_NAME@goldengate.cs.brynmawr.eduwhere UNIX_NAME is your UNIX account name. When prompted, enter your password. Unlike every other Unix command you have used, this one does not complete quickly, rather it effectively opens a terminal on the machine goldengate. So you end up with a terminal onto the UNIX servers that is running inside a terminal that is running on your laptop!
Once you have the ssh terminal running, set up -- on the UNIX servers -- for todays lab.
cd cd CS113 mkdir Lab2
If you have not done so already, open and log into a UNIX machine in the lab and open a terminal. Verify that the Lab2 directory exists.
Finally, close your ssh session (on your laptop) by entering exit.
Using ssh (and scp as described next) means that, in the future, you do not have to set foot in the lab when you want to submit an assignment (if you are doing your work on a laptop). Everything that you would do on a lab computer can be done from within an ssh session.
cd cd CS113 mkdir HW50this assumes you have a CS113 directory (you might have named it CS109). Once you have made the HW50 directory in Unix, open a second terminal on your own computer and in that terminal use "cd" to navigate to the directory containing your work for the assignment. Assuming you use the same directory structure on your own computer and in the lab, this process can be accomplished with the following commands
cd cd CS113 cd HW50Then use the scp command to copy each of the files you want to submit from your computer to the lab. For example you should have a file named Readme (or readme, or README):
scp Readme UNIX_NAME@goldengate.cs.brynmawr.edu:CS113/HW5/Readmescp is case sensitive, so you need to be sure to type the name correctly. As always, when you read "UNIX_NAME" put in your UNIX user name. repeat the scp command for each file in the directory on your laptop. Also, with each scp command you will need to enter your UNIX password.
/home/gtowell/Public/CS113/HW5/cc.txtthis is on Unix. If yo are working on Unix, you can copy it to your local directory as
cp /home/gtowell/Public/CS113/HW5/cc.txt cc.txtlikewise you can copy the file to you laptop using scp using:
scp UNIX_NAME@goldengate.cs.brynmawr.edu:/home/gtowell/Public/CS113/HW5/cc.txt cc.txtif you get messages about "cannot connect" from goldengate, try replacing "goldengate" with "comet".
-42 is not in the range 0 .. 100The program should go through all command line inputs, be there 2 or 200. If all inputs are integers in the correct range, the program should print
The input is good
java Reverse 1 10 7 9 30then your arrays should be
forward = [1,10,7,9,30] reversed = [75.0, 22.5, 17.5, 25.0, 2.5]Hint to do the reversal using a loop. The location of something at location N in the forward array will be at location (reversed.length - 1 - N) in the reversed array. Finally, print the contents of reversed and forward using a "for" loop so the zeroth entry in "forward" and "reversed" appear on the same line, followed by the first, ...
java Reverse 2 4 8 12 5 0: 2 5.0 1: 4 10.0 3: 8 20.0 4: 12 30.0 5: 5 12.5