Questions
- Which of the following snippets represents the most preferred way to perform command substitution?
`command`
-
%(command)
"command"
$(command)
- You need to create an array of names. How would you do that?
set array=names
names=( Vicky Frank Cleopatra Katelyn )
array=names
names=( Vicky Frank Cleopatra Katelyn )
array names
names=( Vicky Frank Cleopatra Katelyn )
declare names
names=( Vicky Frank Cleopatra Katelyn )
declare -a names
names=( Vicky Frank Cleopatra Katelyn )
- How would you view the exit code of a command that you just ran?
echo $#
echo $?
echo $$
echo $!
- You want to create a loop that will read a list of names, and then echo the names...