of Creating Programs on UNIX
162: Introduction to Computer Science II
to Odin using ssh or putty (odin.pdx.edu). If you don't have an odin account
or password you will need to get one. If you don't have one go to: www.account.pdx.edu and for help go to: www.oit.pdx.edu
up the program called ssh – you should be able to find a free site from
which to download it. It is a secure shell program and allows your computer
to act as a ‘dumb terminal’ for logging in remotely. You start up ssh by
double clicking on it.
- Then, connect to: odin.pdx.edu
- Use your odin login name and
- When you login into Odin, Hit
return. Then hit 4
<enter> to exit the menu.
- The very first time you login to Odin to do
your Computer Science homework, you should create a directory where your
programs will live (and where you will work from. To make a new directory
- From then on, you will need to
travel to that directory to actually get your work done. This will need to
happen each time you login. So, to enter that directory to start to work type:
cd cs162 <enter>
- Now you are ready to start typing in your
program. Use pico to type in a program. So, type at the unix prompt:
- Enter in the program; you can use the error keys and
delete to fix mistakes and move the cursor around. There is a menu that
appears at the bottom of the pico screen.
- When done hit control o at the
same time to write it out and control x to exit.
- Compile your C++ source code file. The
command to do this is:
- If your
program successfully compiles, it will produce a file named 'a.out'
in your directory. Otherwise, you will need to correct syntax errors
before continuing - by using pico again:
- One common mistake is to make typos!
- Run your program by typing:
- On due dates, Email your program to email@example.com
the email address is different than your teacher’s email address…)
One way to email in UNIX is to use pine.
This allows you to attach the program file to your email message, which the
grader likes the best.
Before you use pine, you should find out
the name of the path where your file is located. Type pwd<enter> and see what it says…my directory says:
Now we are ready to get into the pine
Select C to compose a message
firstname.lastname@example.org in the To: area
down to the Attchmnt: area
in your program name with its full path
(e.g., mine is: /u/karlaf/cs162/prog1.cpp)
subject should have (a) class name, (b) the word Submission, and (c) your name
CS162 Submission from Beth Miller)
body of the email can be left blank unless you need to communicate something to
send the email press control X at
the same time
- Another way to email programs is to
copy them onto your PC and email them as an attachment using your normal
email program (I use outlook).
great program for transferring files from UNIX to your PC (and vice versa) is
WinSCP. It is free
software that you can download and it works great.