lab2.pdf - Lab#2 Physics 91SI Spring 2013 Objective Some...

This preview shows page 1 - 3 out of 5 pages.

Lab #2 Physics 91SI Spring 2013 Objective: Some more experience with advanced UNIX concepts, such as redirecting and piping. You will also explore the usefulness of Mercurial version control and how to write short “programs” using UNIX commands in the form of shell scripts. As will become usual for the labs, you will ssh into a Corn machine, where you will do these exercises. You do not need X11-forwarding ( ssh -X ), but it can be nice to have a GUI text editor, and it can’t hurt if you have it. Please cd to your Physics 91 SI directory, but do not create a lab2 subdirectory yet - see below. Part 0: Getting Started There’s one bit of administrivia that needs to be done before using Mercurial. Using a text editor ( gedit or nano , or your choice), open the file ~/.hgrc ( note the similarity to the ~/.cshrc file from Lab 1 ). Paste the following text (replacing with your own username), and save the file: [ui] editor = gedit username = John Doe <[email protected]> merge = emacs [merge-tools] emacs.args = -q --eval "(ediff-merge-with-ancestor \"$local\" \"$other\" \"$base\" nil \"$output\")" Also, if you didn’t get to the “Aliases and Links” section of Lab 1, we suggest that you follow these instructions to create environment variables for the course directory and your working directory. First, open, ~/.cshrc and find the section titled “Environmental Variables” ( In gedit, just use Ctrl-f ). Add the following lines (making sure the “ si ” in the first line is lowercase): setenv SICDIR "/afs/ir.stanford.edu/class/physics91si" setenv SI "~/physics91si" Save the file, and when you next log in you’ll be able to access the course directory and your working directory using these environment variables (i.e. cd $SICDIR or ls $SI/lab1/ ). Part 1: Using Mercurial
Image of page 1

Subscribe to view the full document.

survey.py cd into your Physics 91 SI directory; you’re going to create your lab2 directory by cloning the Mercurial repository located in /afs/ir/class/physics91si/src/lab2 . Do this by running the command hg clone /afs/ir/class/physics91si/src/lab2 lab2 Or, if you created an environment variable last class, you can do something like hg clone $SICDIR/src/lab2 lab2 .
Image of page 2
Image of page 3
  • Fall '15
  • editor, Shell script, Redirect

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern