Title: Quiz 11 - Scripting and Variables
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review

Q: Write a command that will keep me from overwriting a file with ">".
A: set -o noclobber

Q: I set up my session so that a <ctrl-d> would not log me out. How do I turn that off so that it will log me out? Just write the command.
A: set +o ignoreeof

Q: Write a command to set a variable called "my_dir_45" to "/home/mydir/dir45".
A: my_dir_45=/home/mydir/dir45

Q: I want to create a short cut called "num" that will run the command "who | wc -l". I do not want to create a script. Write the command I would use to do this.
A: alias num="who | wc -l"

Q: Write a command to list all of the session variables that are currently defined?
A: set

Q: Write a short script that takes two command line arguments, a file name and a directory. The script should copy the file to the directory and display information of what it did, such as "Copied filex to diry". Assume that the file is always the first argument.
A: cp $1 $2 echo Copied $1 to $2

Q: I have set a variable called "mynum". Write a command that I can use to make it go away.
A: unset mynum / mynum=

Q: Why create scripts? Give at least three reasons
A: Automate processes. Reduce boredom. Increase reliability. / Increase efficiency. Get more sleep. It can be fun.