Positional Parameters Flashcards
1
Q
How do you list the number of arguments in a command line?
A
echo $#
2
Q
How do you get the name or path of a command?
A
echo $0
3
Q
How do you get all of the command line arguments?
A
echo $*
4
Q
How do you get the status of the last command?
A
$?
5
Q
How do you print the current process ID?
A
echo $$
6
Q
What is $1, $2?
A
$1 is the first argument after the command name and $2 is the second argument.
7
Q
How do you list ssh supported escape sequences?
A
echo ~?
8
Q
What is $?
A
Status of the previous command.