Difference between revisions of "CSC212 Lab 8 2014"
(Created page with "--~~~~ ---- <br /> <bluebox> This lab is about programming shell scripts, using redirection, pipes, for-loops and various shell tools. </bluebox> <br /> =Connect to Linux= <...") |
(→Connect to Linux) |
||
Line 10: | Line 10: | ||
=Connect to Linux= | =Connect to Linux= | ||
<br /> | <br /> | ||
+ | * For this lab, we won't use Eclipse. We'll use the '''Terminal''' instead. | ||
* Connect to your 212a account on one of the Linux Mint machines, or, using your laptop, directly to beowulf2. If beowulf2 is unresponsive, you can connect from your laptop to any of these IP addresses, which belong to our Linux Mint machines in FH342 and FH345. In this case you should replace '''beowulf2.csc.smith.edu''' by a group of 4 numbers separated by dots. Note that this machine must be ON and have Linux booted and running before you can actually connect to it. You can connect to amachine even if somebody else is using it, or is already connected to it. | * Connect to your 212a account on one of the Linux Mint machines, or, using your laptop, directly to beowulf2. If beowulf2 is unresponsive, you can connect from your laptop to any of these IP addresses, which belong to our Linux Mint machines in FH342 and FH345. In this case you should replace '''beowulf2.csc.smith.edu''' by a group of 4 numbers separated by dots. Note that this machine must be ON and have Linux booted and running before you can actually connect to it. You can connect to amachine even if somebody else is using it, or is already connected to it. | ||
<onlysmith> | <onlysmith> | ||
Line 15: | Line 16: | ||
</onlysmith> | </onlysmith> | ||
<br /> | <br /> | ||
+ | |||
=Redirection= | =Redirection= | ||
<br /> | <br /> |
Revision as of 14:07, 15 October 2014
--D. Thiebaut (talk) 15:07, 15 October 2014 (EDT)
This lab is about programming shell scripts, using redirection, pipes, for-loops and various shell tools.
Connect to Linux
- For this lab, we won't use Eclipse. We'll use the Terminal instead.
- Connect to your 212a account on one of the Linux Mint machines, or, using your laptop, directly to beowulf2. If beowulf2 is unresponsive, you can connect from your laptop to any of these IP addresses, which belong to our Linux Mint machines in FH342 and FH345. In this case you should replace beowulf2.csc.smith.edu by a group of 4 numbers separated by dots. Note that this machine must be ON and have Linux booted and running before you can actually connect to it. You can connect to amachine even if somebody else is using it, or is already connected to it.
Redirection
- Every command, every program in the Linux operating system reads data from the standard-input, and outputs information to the standard-output and the standard-error. By default the standard-input, or sdin for short, is attached to the keyboard.
By default, the standard-output (stdout for short) and the standard-error (stderr for short) are connected to the display.
- Here is a short Java program that outputs to both stdout and stderr:
public class Demo1 { public static void main(String[] args) { System.out.println( "This goes to stdout" ); System.err.println( "This goes to stderr" ); } }
- Note the different streams used to pring: System.out and System.err.
- Run the program in the Terminal