|
|
CS211 Shell Programming
Review for Second Quiz
- The grep command searches...
- streams for uninherited objects
- compiled programs for commands
- text files for patterns
- catacombs for the lost ark
- Which pattern would find all/only files with the extension .bak?
- *[bak]
- ?bak
- *.bak
- ?.bak
- Which operator means to look for a pattern at the start of a line?
- period
- asterisk
- caret
- dollar sign
- A closure is a minimum and/or maximum
- number of characters in a file
- number of characters in a pattern
- number of repetitions of a pattern
- number of times to think about an error
- The grep and wc commands can report the number of times a word appears
in a file...
- if we do at least two searches
- if we search carefully once
- if it appears more than once per line
- if we are incredibly lucky
- Which UNIX calculator uses standard algebraic entry notation?
- ac
- bc
- cc
- dc
- What are three environment variables and what do they hold?
- ________________________________________________
- ________________________________________________
- ________________________________________________
- Which calendar command would show July of 1997?
- cal 7
- cal 7 97
- cal 7 1997
- cal [35612-35642]
- What is an exported variable?
- one that is passed to a program
- one that is passed to a second shell
- all variables are exported
- variables cannot be exported
- Where does control go when a subshell finishes running?
- to the locker room for a shower
- to its reward, but only if it was very good
- nowhere: the script ends
- back to the shell or command that called the subshell
- File descriptors are
- numbers that stand for file streams
- names of files in a directory
- the permissions lists for files
- fully qualified path statements for files
- If you want to write a simple, two-line file, you might use:
- cat filename
- cat > filename
- echo filename
- cat << filename
- If the cat command is not given an input filename, it assumes
- you made a mistake and prints an error message
- you are silly and beeps at you
- you will continue input from stdin
- that this is a good time to re-boot
- The tee command is useful for
- covering up at the beach
- sending output to the screen
- sending output two places at once
- preventing screen output from reaching the screen
- When creating and using an archive file, which is more important?
- the number of files going into the file
- the use of << and stop values
- the use of remarks
- the use of permissions
- Which of these have to do with executing files without x permissions?
- the period and sh
- buying the sysop a really nice present
- the secret login of the sysop
- The
Treasure of the Sierra Madre ("Badges?...")
- Which of these does not grant all users execute permissions?
- chmod 751 filename
- chmod u+x filename
- chmod +x filename
- chmod 777 filename
- Parameters to a script are also called
- command line arguments
- exported variables
- soft switches
- shell add-ons
- With respect to this command:
sh scriptname UNIX is Klingonese
What is the value of:
- $0 ______________________________________________
- $2 ______________________________________________
- $# ______________________________________________
- $* ______________________________________________
- Debugging may be approached with scripts by using
- the -d option
- the -v option
- the -x option
- the -bug option
|