Frequently Asked Questions about JHUNIX

Do I have an account on jhunix?
Probably. If you have never logged in, your password will be set to your initial HITS password.

What if I forgot my password on jhunix or don't have an account there at all?
Go to HITS Account Setup Web Page. You will need to know your jhed system login and password. If you are not a Homewood student, send Dr. Houlahan an email requesting a letter to get an account.

What if I set up my jhunix account, but I still can't get into it?
Call 410-516-HELP for HITS support. There is nothing Dr. Houlahan can do to help you with this.

What is jhunix?
Jhunix is an SGI Challenge multi-user server system that uses the Unix operating system.

How do I get to jhunix from a PC?
First of all, your PC must have an open internet connection. This is always true for the machines in the Krieger Lab. One option is to open a web browser (Netscape for example), and then type telnet://jhunix.hcf.jhu.edu in the location bar and hit GO. Another is to locate the telnet program on the PC and give jhunix.hcf.jhu.edu as the location. Sometimes from the Start menu you can choose "Run..." then type telnet jhunix.hcf.jhu.edu to get connected.

How do I learn to use Unix?
There is a tutorial program available to get you started. After you log-on, type ~jhoulah1/bin/nixtutor to run it. You should also consult some on-line resources.

How do I create my program files on jhunix?
After logging in, you will need to use a unix-based text editor. The choices are pico, emacs, or vi. Pico is by far the easiest to use. It is the program that Pine (the e-mail software) runs when you wish to compose a message. Emacs is a little more difficult to figure out, but is targeted largely towards computer programmers and therefore has many nifty features for use in program development. Vi is perhaps the most powerful editor, but is not user friendly at all. For more information on using these programs, try brief guide to the pico editor, brief guide to the emacs editor, brief guide to the vi editor. When you save a program from these editors, it will be written onto the disk space allocated for your account, in the current file directory.

How do I compile and run C++ programs on jhunix?
The best compiler to use is g++. Suppose you have created a C++ program file called myprog.cpp using one of the editors above. At the unix prompt, you would then type

ex1:	g++ myprog.cpp
 or 
ex2:	g++ myprog.cpp -o myprog
in order to compile it. If your program is compile-error free, the first example will compile your source file, myprog.cpp, and create an executable file named a.out (assuming myprog.cpp contains a main function). The second example will read in your source file, myprog.cpp, and create an executable file named myprog. If the compiler finds errors in your program, it will print them to your terminal and no executable file will be created. You must go back to edit your program and correct the errors, then try compiling again. Sometimes the compiler will just give a warning, such as
    ld: WARNING 84: /usr/lib32/libm.so is not used for resolving any symbol.
You can ignore these warnings. No ERRORs means a successful compilation. It is a good idea to remove any existing a.out or other executable files before compiling a program so that you don't mistakenly think that the old one is current.

Once your program has compiled, you can test and run it by typing:

ex1 continued: 	./a.out
 or 
ex2 continued:	./myprog
Remember that you must hit the return/enter key after each line of input that you give a program.

How do I get out of jhunix?
Type "exit" at the command prompt to log out, then close any telnet window that may be open. It is really important to always log out before leaving a public machine!!

How do I submit my programs?
See the electronic submission webpage for detailed instructions.

How do I print my programs?
Use the "lp" Unix command to print your programs. Remember to print only source code, never an a.out or other executable file. To print a file named "pg1a.cpp" in the Krieger computer lab type

	lp pg1a.cpp
at the Unix command prompt. Ask the HACLab people in Krieger 160 where it comes out. You will need to swipe your J-card to get it. Make sure your name is in all your programs (as comments) so you can identify your programs. Make sure you pick up all your printouts so other students don't find them and copy your work.

How do I copy files from my home PC to jhunix (and vice versa)?
You can use FTP if it is installed on your PC. A better way is to use a program called SCP (secure copy). You can get a free Windows SCP client called WinSCP at winscp.vse.cz/eng/ . In order to get this program to work one must select (on the Advanced tab) preferred SSH protocol version 2 with the "imitate SSH2 MAC bug..." checked. You need to make sure you click preferred SSH protocol version 2 before the option "imitate SSH2 MAC bug..." will appear. Here is a screen shot. Make sure that your files compile and run correctly on jhunix specifically before submitting them! There are some differences in compilers. (Also, see instrutions on mailing files from jhunix to wherever below.)

How do I send email from jhunix?
JHUNIX doesn't have a nice mail program available. However, there is a very limited unix command to mail a file: mail me@wherever < filename where you must substitute your email address for me@wherever (make sure this is surrounded by spaces) and the actual name of the file being mailed for filename. Do this for each file you want to send somewhere. Do NOT use a '>' instead of a '<' symbol - it will erase your original file!

How do I print my jhunix program files on my own printer?
You can't print to your home computer directly from jhunix. One option is to cut and paste your program into a document on your PC (in Word or something similar) and then print from there. Use control-insert to copy and shift-insert to paste. Another approach is to mail your files from jhunix to your preferred email account (see above), save it as a file (delete the email header information and check for linebreak changes), and then print it.

What if my account is getting full?
You can delete all your executable files (a.out and any others that you've created) to make space. These files are generally very large. Do NOT delete your program files (*.cpp or *.h) in case there is a problem with your submission.

How do I compile multiple files on jhunix?
When, later in the course, you have multiple files to compile for one program (eg: class implementations) include them all in the list:

	g++ classname.cpp driver.cpp [-o driverexecutable]
Only one executable is created and only one of those files should have a main(). By default it is named a.out, unless you use the -o option to give it a name.


[CS109 Home] [Assignments] [Computer Use] [TA Info & Hours]
[Syllabus] [Ethics Code] [Dr. Houlahan]