HANDS-ON SESSION
Prof. Donald Dabdub
·
How do I access
my ea account?
Usually, once you login into a computer in Lab C (assuming you already activated your ucinetid account) there should be an icon that allows you to connect to EA. Double-click on it and logon with the same username (ucinetid) and password you used before. Your account on ea uses a unix-type operating system. Unix is case sensitive which means that any command should be typed as appears below, otherwise will not work.
·
Use of ls Unix command
ls lets you see the content of your home directory
Example:
ea>ls
mail/ myfile1* somethinghere.txt
in this case you see a directory (that should contain your email), an executable file (that is what the asterisk means), and a plain text file.
·
Create a new
directory
To do so, you will need the mkdir command as follows:
ea>mkdir mae10
ea>ls
mae10/ mail/ myfile1* somethinghere.txt
here you have created the mae10 directory.
·
Use of cd Unix command
To move under that directory you will need the cd command:
ea> cd mae10
ea>ls
at this point you should have moved under mae10 and because it was just recently created there should be nothing there. If you use cd again you should come back to your home directory (default behavior):
ea>cd
ea>ls
mae10/ mail/ myfile1* somethinghere.txt
HANDS-ON SESSION
Prof. Donald Dabdub
·
Create a file
(your first fortran program)
Move back under the mae10 directory that you just created (ea>mv mae10). There are two popular text editors in Unix: vi and emacs, I would highly recommend you learn one of them. In your accounts there is a third option called pico which is much simpler and would do the work for the editing of your codes in this course. Create a file and name it hello.f (hello is the name and .f is the extension which in this case means fortran 77 file)
ea>pico hello.f
you should see a screen with commands at the bottom, you can type your code now:
c23456789
program hello
c This is the simplest code in fortran and writes the word hello on the screen
write(*,*) 'hello world'
end
Save it with Ctrl-o (all the other commands are
Ctrl-the_indicated_letter_at_bottom ) and exit Ctrl-x
·
Compile your
program
The compiler available in your account is called f77. Type
ea>f77 -o hola hello.f
hello.f:
MAIN hello:
The flag -o tells the compiler to create an executable named hola. When you run this
ea>hola
hello world
it puts the message on the screen as expected.
·
Other useful
commands
rm : remove a file. ea>rm hola
mv : move (rename) a file. ea>mv hola wassup renames hola to wassup
ea>mv hola mydir/ moves hola under directory mydir
pine: mail client on your unix account. This can help you to attach files and send them to your grader. Remember that to attach a file you use Ctrl-j in the compose message screen.