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- Go to your ex directory
cd ex- Create an ex11 directory
mkdir ex11- Go to your ex11 directory
cd ex11- Execute the script command
script- Use your perlsession alias to start the re.pl script.
perlsession(NOTE: If the perlsession alias is not recognized, or if re.pl cannot run, then double-check your Perl configuration, as well as your login shell vs. subshell environments!)Hash operations
perl> %ipMac = ('192.168.124.1', '2a:09:4e:3c:31:42', '192.168.124.2', '0e:88:4e:2a:56:07', '192.168.124.3', '1a:32:6f:5c:6b:1a'); perl> print %ipMac; perl> print $ipMac{'192.168.124.1'}; perl> print $ipMac{'192.168.124.2'}; perl> print $ipMac{'192.168.124.3'}; perl> $newIP = '192.168.124.4'; perl> $ipMac{$newIP} = '2a:09:4e:2a:56:07'; perl> print "IP $newIP has the MAC: $ipMac{$newIP}"; perl> @ipMacKeys = keys(%ipMac); perl> foreach $k (@ipMacKeys) { print "$k\n" ;} perl> foreach $k (@ipMacKeys) { print "$k : $ipMac{$k}\n" ;} perl> @ipMacValues = values(%ipMac); perl> foreach $v (@ipMacValues) { print "$v\n" ;} perl> delete $ipMac{'192.168.124.2'}; perl> @ipMacKeys = keys(%ipMac); perl> foreach $k (@ipMacKeys) { print "$k : $ipMac{$k}\n" ;} perl> $ipMac{'192.168.124.1'} = 'foo'; perl> $ipMac{'192.168.124.4'} = 'bar'; perl> foreach $k (@ipMacKeys) { print "$k : $ipMac{$k}\n" ; }(Before closing your perlsession, experiment some with hashes to see what they will do...
In other words, make up some Perl code, similar to what you see above, but different enough to involve other aspects of hashes not covered here...
I will be looking for this.)End the Perl Session
perl> exitEnd the script session
Use the exit command. You should then have a file called typescript in your current working directory.