Purpose
The purposes of this exercise are...
- If you don't already have one, to create a Unix account AND Windows account.
- To apply this course, so that the admins will create a course folder for you.
- Check out the perl utility on the Linux server.
It is important that you complete this exercise now, because you will not be able to do any further work in this course until you do.
Applying
Completing the apply process in the past was very complicated. Fortunately, we now have a web application that your can use. You will find instructions here: http://www.cs.umb.edu/~ghoffman/linux/apply_process.html
(Where the directions advice you to e-mail Professor Hoffman, you should e-mail me, instead.) The directions should also guide you to getting your Windows account.(NOTE: If you do not have a Linux account now, do this when your account is working and you have an it441 directory.)
You will need to be able to SSH into your Linux account. On a Mac or Linux computer, you can use your standard Terminal program. On a Windows computer, you will need a utility like SSH Secure Shell Client or PuTTY. (This site has more detailed directions for SSH Secure Shell Client.)
Log in to users.cs.umb.edu
- Log in to a Windows machine
Enter your Unix username as the account name. Then enter your password.- Run the ssh client
Use the values in the table below to connect to users.
ssh configuration parameter value protocol ssh ssh version 2 ssh port 22 host users.cs.umb.edu user name your unix username Authentication method password Enter your password
A dialog box will appear on the screen into which you must type the password for your Unix account.
- Make sure you are in your home directory
cd- Go to your it441 directory
cd it441- Create an ex directory
mkdir ex- Go to your ex directory
cd ex- Create an ex01 directory
mkdir ex01- Go to your ex01 directory
cd ex01- Start up a script session
scriptLooking at Perl
At the shell prompt, enter the command: perl -v
Take note of the version number. There may be some differences between this version of Perl and others that you encounter.Get the path to your current directory
pwdWhile leaving your current ssh session window (#1) open and running...
...open up a separate ssh session in another window (#2) on users.cs.umb.edu and navigate to that same directory. Inside there, create the file hello.pl (note that .pl is referring to lowercase of P and L) with the following content:#! /usr/bin/perl -l print "Hello, world!" ; print "Number: " . 6 ; print "Number: " . (2 + 4) ;Why are we doing our file editing in a separate session, instead of within the script session in our original window?
Back to your original session window (#1)...
Do a long listing to confirm that hello.pl exists:ls -lConfirm that hello.pl has correct contents:cat hello.plMake the script executable:chmod 755 hello.plRun the script:./hello.plWhat would happen if the first line were simply #! /usr/bin/perl and we left out the -l part?
If you like, you may edit the file hello.pl back in the other window (#2) and run it again in #1.Back to your original session window (#1)...
Exit your script session
exitConfirm you have a typescript file in your ex01 directory
ls -lConfirm the typescript file is readable
less typescriptLook through the file and exit the less utility by typing q when finished.