Classes 24-25 review (07/15-16/2002)

  1. Everything you ever wanted to know about PERL substitution, with g for global and i for ignore case. Good review of PERL arrays too. You could even learn something about output redirection operators (DOS or UNIX) and the Unix cat command options too.

  2. Monday email summary note.

  3. Tuesday email summary note.

  4. Tuesday example PERL, which opens a file for input that is not in the same directory as the PERL program, but in its PARENT .. directory.

    [jacobson@math-cs 088]$  ls ../c088*
    
                   ../c088.html                 ../c088first4wks.html
                   ../c088PERLsummer2001.html   ../c088firstHalf.html
    
    [jacobson@math-cs 088]$ pwd
    
                            /home/jacobson/web/088      
    
  5. View the Source, to see .. used in HTML, to link to a file in the parent folder's js folder, like this: ../js/makeJavaScript.txt is the link with hypertext indicating the underlying anchored reference specification from A HREF=theURL.

  6. JavaScript debugger program for Netscape. Notice name for software!

After exporting the Monday and Tuesday email notes from pine 
                                    as 
                                       emailJuly15th.txt and 
                                       emailJuly16th.txt, which
      creates the .txt files in my home directory,
      how did I move them into my jacobson/web/088 folder???

      Note that the web folder's 088 folder was my current directory.

      cd ..      would do what?   Go to 088's folder's parent directory.
      cd ..      closes the 088 folder (subdirectory) and moves you
                         to 088's parent, .., which is web.
      cd ..      at that point, would move you to the ~ or home directory,
                 which in my case would be jacobson or else venkman
                 on my student test account.

      So how did I move the two emailJuly*.txt files from the jacobson
      folder to the current directory, which was jacobson/web/088?

      [jacobson@math-cs 088]$ mv ~/emailJuly* .
      [jacobson@math-cs 088]$ pwd
                              /home/jacobson/web/088           

      pwd stands for present working directory
                     -       -       -         
                     p       w       d

      Whatever that present working directory is, you can refer to it
      as .
      and you can refer to its parent directory as ..

      mkdir newDirectory
      cd newDirectory
      
[jacobson@math-cs 088]$ mkdir newDirectory
[jacobson@math-cs 088]$ cd newDirectory
[jacobson@math-cs newDirectory]$ ls -a
.  ..

[jacobson@math-cs newDirectory]$
[jacobson@math-cs newDirectory]$ cp ../class22.html  .
[jacobson@math-cs newDirectory]$ ls -a
.  ..  class22.html

[jacobson@math-cs newDirectory]$
[jacobson@math-cs newDirectory]$ cp ~/web/c088.html .
[jacobson@math-cs newDirectory]$
[jacobson@math-cs newDirectory]$ ls -a
.  ..  c088.html  class22.html

[jacobson@math-cs newDirectory]$ ls -al
total 16
drwxr-xr-x    2 jacobson cns_fac      4096 Jul 16 17:25 .
drwx--x--x    3 jacobson cns_fac      4096 Jul 16 17:23 ..
-rw-r--r--    1 jacobson cns_fac      3146 Jul 16 17:25 c088.html
-rw-r--r--    1 jacobson cns_fac      1548 Jul 16 17:24 class22.html

[jacobson@math-cs newDirectory]$ pwd
/home/jacobson/web/088/newDirectory   


The fastest way to get back to your home directory, is

   cd

Another way, is 

   cd ~

The slowest way here from the newDirectory folder, would be

   cd ..      You are now in 088 folder
   cd ..      You are now in web folder
   cd ..      You are now in the jacobson or home directory folder

[jacobson@math-cs newDirectory]$ pwd
/home/jacobson/web/088/newDirectory   

   The .. of newDirectory is 088, and
   the .. of 088 is web, and
   the .. of web is jacobson.    Read .. as parent.
                                 For every .., . is the child, when you do
                                                               ls -a in 
                                                               Unix and
                                                        see the normally
                                                        hidden .. and .
                                                        listings.
Here is a DOS and Windows command prompt example 
illustrating the same thing, with a Windows high density diskette 
being the magnetic media stored in the A: drive.

A:\> md Summer2002

A:\> cd summer2002

A:\Summer2002> dir

 Volume in drive A has no label
 Directory of A:\Summer2002

.                      07-16-02  5:32p .          Current directory .
..                     07-16-02  5:32p ..         Parent directory ..
         0 file(s)              0 bytes
         2 dir(s)       1,404,416 bytes free

A:\Summer2002> copy  C:\perl\bin\movie*.p  .

C:\perl\bin\movies.p
C:\perl\bin\movies2.p
C:\perl\bin\movies3.p
        3 file(s) copied

A:\Summer2002> dir

 Volume in drive A has no label
 Directory of A:\Summer2002

.                      07-16-02  5:32p .
..                     07-16-02  5:32p ..
MOVIES   P             281  07-16-02  2:40p movies.p
MOVIES2  P             201  07-30-01 10:47p movies2.p
MOVIES3  P             561  07-30-01 11:24p movies3.p
         3 file(s)          1,043 bytes
         2 dir(s)       1,402,368 bytes free