NEW BRUNSWICK COMPUTING SERVICES
USER SERVICES GROUP

Intermediate Use Of The UNIX Operating System
Exercise 1

Customizing your environment

After completing this lab, you will be able to distinguish among three basic UNIX shells, to use the search path, to set and use variables, to create aliases, and to create shell scripts.

  1. In the login session, enter the command: cd ; cd UNXclass ; echo $0
    What was the response?
    Which shell are you in?

  2. Enter the command: ./newshell.1
    What shell is "newshell.1"? (Use the technique in problem #1)
    Exit this shell and then enter the command: ./newshell.2
    What shell is "newshell.2"?
    Exit this shell and then enter the command: ./newshell.3
    What shell is "newshell.3"?
    Make sure you exit from this shell back to your login shell.

  3. Use the "echo" command to display the value of your "EDITOR" variable.
    Write the command here
    Put the results here

  4. Start a new session on Eden or RCI, DO NOT logout of your original session.
    Once logged in type the command setenv PATH . and then try the commands ls, who, or ps, What happened?


  5. In the session with the faulty PATH setting, how can you use "emacs" if it is not in your path? (hint see #3)
    Put your answer here.

  6. EXTRA: On Eden, type the command:
    mv ~/.cshrc ~/.cshrc.orig ; cp ~/.cshrc.orig ~/.cshrc
    (The above is to preserve the current working settings in case the editing you are about to do messes up your startup file). Create an alias called "pf" to run "ps -ef". Create it at the command line, and when you have got it working use emacs to add it to the bottom of your current .cshrc (on RCI you may have to create a new .cshrc file). Make sure to end the line you add with a carriage return and to save and exit the emacs session.
    What is the command that creates the alias?

    Start a new session on RCI or Eden. Then try the pf command.

  7. EXTRA: Create a shell script to print out information about your own personal login environment. Name it "myinfo". It should use the commands "ps", "id", "whoami", and "pwd". Write the script here (it should be short!)


After attempting the above look here for answers

End of Practice 1 - Customizing your Environment