a2/questions.txt Examples -------- Q: Who is the UCB grad student that wrote both the C Shell and vi? A: Bill Joy Q: What is the result of the following command? date >x >y A: Both x and y are created. y holds the output of date. x remains empty. Questions for you to answer! ---------------------------- Q: In your own words, what's the difference between an option and an argument? Q: Look at the first two invocations of fgrep on slide 26. Why is it useful to have "Hello.java:" prepended to the matching lines in the second invocation but not the first? Q: Write a command line that runs args.java with a series of arguments that cause it to produce the following four lines of output. (The four lines are in a2/args.out, should you wish to examine them with an editor.) |"""| |' '| |\ /| ||||| Q: For some command CMD, when is it correct to use "help CMD" instead of "man CMD"? Q: In your own words, what is the difference between IO redirection and piping? Q: IO redirection facility in bash allows bash to check for various errors, eliminating the need for those error checks in programs. What is an example of a redirection-related error that bash checks for? Q: Consider the following command. How many arguments are being passed to the program prog1? prog1 a < b 'd e f' h i -j 10 > k 1\ 2\ 3 4 Q: Look at the output of "ls /" and the output of "ls / | wc -l". What seems inconsistent between the two outputs? Q: When presenting the last example on slide 48 I claimed that java's never started. Devise and conduct a simple experiment to support or refute that claim. Describe the experiment and your findings. Q: What does java lc < /etc/passwd > java lc do? (Note: Try to be very precise with the wording of your answer.) Q: Imagine that pipes hadn't been invented. How could we make the output of "java iota 100" be the input of "java rev"? (Don't make this question hard; it's intended to be easy!) Q: Name two editors available on lectura other than Emacs, Vim, pico, and nano. Be careful! Some editors can be invokved with different names to produce variations in behavior. The man page for vim shows that it can be invoked with ten different names in addition to "vim".