CS 390 Quiz 5

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Like find, sed also supports a negation operator (__). For instance, selecting the first two lines is the same as not selecting lines 3 through the end: sed -n '3,$!p' emp.lst

!

Note the comment character for a shell script, ___, which can be placed anywhere in a line. The shell ignores all characters placed on its right. To run the script, make it executable first:

#

Special parameter used by the shell: PID of last background job

$!

Special parameter used by the shell: PID of current shell

$$

Special parameter used by the shell that stores the complete set of positional parameters as a single string.

$*

Special parameter used by the shell: Complete set of positional parameters as a single string

$*

Special parameter used by the shell: Positional parameters representing command-line arguments

$1, $2, ...

Special parameter used by the shell: Exit status of last command

$?

test doesn't display any output but simply sets ______

$?

for is also used to process positional parameters that are assigned from command-line arguments: for file in "$@" From command-line arguments Note that "_____" is preferred to $*. for will behave erroneously with multiword strings if $* is used.

$@

We sometimes encounter situations when the source pattern also occurs at the destination. We can then use ____ to represent it. (in basic regular expressions)

&

The shell provides two operators that allow conditional execution—the ______ and _____ (also used by C), which typically have this syntax: cmd1 && cmd2 cmd2 executed if cmd1 succeeds cmd1 || cmd2 cmd2 executed if cmd1 fails

&&, ||

The _____ option allows you to enter as many instructions as you wish, each preceded by the option. We can repeat the command prior to the previous one with this: sed -n -e '1,2p' -e '7,9p' -e '$p' emp.lst

-e

Numerical operator for equal to

-eq

When you have too many instructions to use or when you have a set of common instructions that you execute often, they are better stored in a file. What is the options that you can use with sed to take instructions from a file?

-f

Numerical operator for greater than

-gt

Numerical operator for less than or equal to

-le

Numerical operator for not equal to

-ne

The length of a string is handled by the regular expression ____. It signifies the number of characters matching the pattern, i.e., the length of the entire string: $ expr "robert_kahn" : '.*' Note whitespace around : 11

.*

Consider a simple example. Suppose you want to replace the words henry higgins with higgins, henry. The sed instruction will then look like this: $ echo "henry higgins" | sed 's/\(henry\) \(higgins\)/\__, \__/' higgins, henry

2, 1

Alternatively, you can place multiple sed instructions in a single line using the ___ as delimiter.

;

You can perform multiple substitutions with one invocation of sed. Simply press [______] at the end of each instruction, and then close the quote at the end.

Enter

The shell's _____ variable contains a string whose characters are used as word separators in the command line. The string normally comprises the whitespace characters. We need od -bc to view them: $ echo "$IFS" | od -bc 0000000 040 011 012 012 Space, tab and newline constitute IFS \t \n \n 0000004

IFS

The test s1 = s2 is true if...

String s1 = s2

The tagged regular expression (TRE) uses ____ and ___ to enclose a pattern. The grouped pattern gets the tag \1, \2, and so on. The feature is useful in reproducing a portion of the source pattern at the target.

\(, \)

Sed command to append text

a

Shell functions are better than __________ in every way. Like shell scripts, a shell function supports all positional parameters (including $#, "$@", etc.). It can also return an exit status with the return statement.

aliases

You'll often use expr with command substitution to ___________ a variable. Some scripts in this chapter use it for incrementing a number: $ x=6 ; y=2 $ z=`expr $x + $y` ; echo $z 8 $ x=`expr $x + 1` This is the same as C's x++ $ echo $x 7

assign

For string handling, the Bourne shell must be used with expr and ___________.

basename

The previous string extraction function can be easily performed by __________. The command by default extracts the "base" filename from an absolute pathname: $ basename /usr/include/sys sys When basename is used with a second argument, it strips off the string represented by this argument from the first argument: $ basename hello.java .java hello Easier than expr

basename

You can also extract a file's ____________ from an absolute pathname: $ pathname="/usr/include/sys" $ expr "$pathname" : '.*/\(.*\)' sys

basename

Unlike expr, but like awk, _____ can handle floating-point calculations. This command was discussed in the first edition of this book but has subsequently been removed. bc is quite useful in the standalone mode as a simple calculator, so let's have a look at this feature first:

bc

Apart from the command prompt, shell functions can be defined at a number of places: • At the _____________ of the script using them or at least preceding the function call. This is because shell statements are executed in the interpretive mode. • In the profile so they are available in the current shell. Korn and Bash users should place the definitions in the rc file. • In a separate "library" file. Every script using these functions needs to source the file at the beginning with the dot command.

beginning

The _______ statement causes control to break out of the loop. The continue statement suspends execution of all statements following it and starts the next iteration.

break

Sometimes, you'll find it difficult to specify when a loop must terminate. You may also need to make a premature iteration from any point in the loop body. All loops support the _________ and __________ keywords that perform these tasks—often in an infinite loop.

break, continue

Sed command to change text

c

expr supports the TRE that was first seen in sed, but only to extract a substring. Unlike in sed, however, there's no \1 and \2; the expression enclosed by \( and \) is actually returned by expr as its output. This is how you extract the two-digit year from a four-digit string: $ stg=2004 $ expr "$stg" : '..\(..\)' Extracts last two ______________ 04

characters

The arguments to set are often obtained from _____________ ___________. This is how we can access every field of the date output: $ set `date` $ echo "$@" Wed Jan 8 09:40:35 IST 2003 $ echo "The day is $1 and the date is $2 $3, $6" The day is Wed and the date is Jan 8, 2003

command substitution

if and test can also be used with ___________ conditions. There are two forms: one uses the && and || operators, and the other uses -a and -o.

compound

In a while loop, the commands enclosed by do and done are executed repeatedly as long as _________ remains true.

condition

If conditional evaluates the success or failure of the ___________ __________ specified in its "command line." If command succeeds, the sequence of commands following it is executed. If command fails, then the commands following the else statement (if present) are executed.

control command

Shell scripts are thus slower than compiled programs, but speed is not a constraint with certain jobs. Shell scripts are not recommended for number crunching. They are typically used to automate routine tasks and are often scheduled to run noninteractively with ______. System administrative tasks are often best handled by shell scripts, the reason why the UNIX system administrator must be an accomplished ________ programmer.

cron, shell

Sed command to delete text

d

For a for loop, the keywords ____ and _______ delimit the loop body. Loop iteration is controlled by the keywords variable and list. At every iteration, each word in list is assigned to variable, and commands are executed. The loop terminates when list is exhausted.

do, done

This is expensive, so remove redirection from there and provide it instead at the ______ keyword: done >> addressbook addressbook opened only once This redirects the standard output of all statements in the loop body.

done

______ is a built in linux or unix command. The eval command is used to execute the arguments as a shell command on unix or linux system. Eval command comes in handy when you have a unix or linux command stored in a variable and you want to execute that command stored in the string. The eval command first evaluates the argument and then runs the command stored in the argument.

eval

Your study of the mechanism of process creation (7.5) led you to the exec family of system calls. This feature has some importance to shell scripters who sometimes need to replace the current shell with another program. If you precede any UNIX command with _______, the current process is overlaid with the code, data, and stack of the command.

exec

For manipulating strings, _____ uses two expressions separated by a colon. The string itself is placed on its left, and a regular expression is placed on its right. We'll use expr to determine the length of a string and to return a substring.

expr

To validate a string so that it doesn't exceed, say, 20 characters in length, you need to use _____ like this: if [ `expr "$name" : '.*'` -gt 20 ] ; then

expr

_______ performs the four basic arithmetic operations and the modulus (remainder) function. It handles only integers; decimal portions are simply truncated or ignored. $ x=3 y=5 Multiple assignments without a ; $ expr 3 + 5 Whitespace required 8 $ expr $x - $y -2 $ expr 3 \* 5 Escaping keeps the shell out 15 $ expr $y / $x 1 Decimal portion truncated $ expr 13 % 5 3

expr

Unlike any programming language, the Bourne shell doesn't have computing or string handling features at all. It depends on the external commands, _______ and _____, for integer and floating-point computing, respectively.

expr, bc

Test 'f1 -ef f2' is true if...

f1 is linked to f2 (Korn and Bash only)

Test 'f1 -nt f2' is true if...

f1 is newer than f2 (Korn and Bash only)

Test 'f1 -ot f2' is true if...

f1 is older than f2 (Korn and Bash only)

while true The true command returns 0 while : : also returns a true value true and : do nothing except return a true exit status. Another command named _________ returns a false value.

false

Test '-u file' is true if...

file exists and has SUID bit set

Test '-k file' is true if...

file exists and has a sticky bit set

Test '-L file' is true if...

file exists and is a symbolic link (Korn and bash only)

Test '-e file' is true if...

file exits (Korn and Bash only)

When the list consists of wild cards, the shell interprets them as ___________. Often, the list is either very large, or its contents are known only at runtime. In these situations, command substitution is the preferred choice.

filenames

The shell features the for, while, and until loops that let you perform a set of instruc- tions repeatedly. The ____ loop doesn't support the three-part structure used in C, but uses a list instead: for variable in list do commands Loop body done

for

The ______ _________ is the fourth source of standard input, and it finds place here because it's often used in a shell script to make a command take input from the script itself. This mechanism is very convenient to use with commands that take no filename as argument.

here document

Sed command to insert text

i

You can also negate the control com- mand using _____ ____ condition.

if !

To ____________ a number, enclose the expression in double quotes (even though quotes are not necessary for this trivial example): $ x=5 $ echo "$x + 1" | bc Value of x is still 5 6 $ x=`echo $x + 1 | bc` No quotes necessary $ echo $x 6 x reassigned

increment

sed uses _________ to act on text. An instruction combines an address for selecting lines, with an action to be taken on them, as shown by the syntax: sed options 'address action' file(s)

instructions

We have matched a pattern at the beginning and end of a line. But what about match- ing it at any specified location—or within a zone? sed and grep also use the _________ regular expression (IRE) that uses an integer (or two) to specify the number of times the previous character can occur.

interval

The __________ __________ ___________(IRE)—uses the characters { and } with a single or a pair of numbers between them.

interval regular expression

When a script is sent any of the signals in signal_list, trap executes the commands in command_list. The signal list can contain the integer values or names (without the SIG prefix) of one or more signals—the ones you use with the _____ command. So instead of using 2 15 to represent the signal list, you can also use INT TERM (the recommended approach).

kill

sed -f allows you to do what?

lets you take instructions from a file

sed -e allows you to do what?

lets you use multiple instructions

POSIX advocates the use of _________ over bcopy, but how does one replace bcopy with memcpy using sed? To assess the viability, let's have a look at how the previous function would have to be reframed using memcpy: memcpy(&name.sin_addr, hp->h_addr, hp->h_length);

memcpy

In TRE, to reproduce a group at the destination, you have to use the tag \___. This means that the first group is represented as \1, the second one as \2, and so forth.

n

The function is invoked by its _______ (without the parentheses), optionally followed by its arguments. The value returned is numeric and represents the success or failure of the function. This is how you convert the sequence ls -l filenames | less to a function: $ ll() { > ls -l $* | less >} and then run it with or without arguments: ll ll *.c *.java Function defined in the command line is available in current shell only () can't be used

name

Because bc accepts standard input, we can use it in a _____________. The following statement also computes the value of 22 / 7 expressed up to five decimal places. Note the use of the ; as the statement terminator: $ echo "scale = 5 ; 22 / 7" | bc 3.14285

pipeline

In a while loop, if you want to do the same thing an infinite number of times, then use _____ itself as the control command inside an infinite loop. $ while ps -e ; do Always true as ps returns true > sleep 3 > done

ps

The _______ statement is the shell's internal tool for taking input from the user, i.e., making scripts interactive. It is used with one or more variables that are assigned by keyboard input.

read

test is so widely used that fortunately there exists a shorthand method of executing it. A pair of _____________ ____________ enclosing the expression can replace it. Thus, the follow- ing forms are equivalent: test $x -eq $y [ $x -eq $y ]

rectangular brackets

The second form suggests that sed "remembers" the scanned pattern and stores it in // (two frontslashes). The // is here interpreted to mean that the search and substituted patterns are the same. We call it the ____________ __________ .

remembered pattern

A set of two slashes (//) as the source pattern represents the expression used for scanning a pattern (the ___________ _________). The & reproduces the entire source pattern at the target (the ______________ pattern).

remembered pattern, repeated

The ___________ ________—uses a single symbol, &, to make the entire source pattern appear at the destination also.

repeated pattern

$ bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. _______=2 Two places of decimal 5* 3 15 scale=5 22/7 3.14285 quit Or [Ctrl-d] $

scale

When the command is invoked without arguments bc turns interactive. Input has to be keyed in through the standard input, and bc interprets it either as its own internal command or as an expression. By default, bc performs integer computation, so the _________ statement must be used to set the number of decimal places. The bc command supports the standard arithmetic operators, but what makes it very useful in Linux is the history feature that lets you recall the previous commands of the current session.

scale

When a group of commands have to be executed regularly, they should be stored in a file, and the file executed as a shell ______ or shell _________. Though it's not mandatory, using the .sh or .bash extension for shell scripts makes it easy to match them with wild cards.

script, program

____ is a multipurpose tool that combines the work of several filters. It is derived from ed, the original UNIX editor (not discussed in this text). sed performs noninteractive operations on a data stream—hence its name.

sed

sed processes several instructions in a ___________ manner.

sequential

We may need to extract all words from single-line command output without using the services of cut and awk. The shell's _____ statement does a perfect job of this. set assigns the values of its arguments to positional parameters (like $1, $2, etc.) as well as $#, $*, and "$@": $ set 9876 2345 6213 $ echo "\$1 is $1, \$2 is $2, \$3 is $3" $1 is 9876, $2 is 2345, $3 is 6213 $ echo "The $# arguments are " $@"" The 3 arguments are 9876 2345 6213

set

The first line of script.sh contains a string beginning with #!. This is not a comment line. It is called the interpreter line, hash-bang, or ____-______ ______. When the script executes, the login shell (which could even be a C shell) reads this line first to determine the pathname of the program to be used for running the script. Here, the login shell spawns a Bourne sub-shell which actually executes each statement in sequence (in interpretive mode).

she-bang line

What makes shell programming powerful is that the external UNIX commands blend easily with the shell's internal constructs in _______ scripts.

shell

A _______ ________ executes a group of statements enclosed within curly braces. It option- ally returns a value with the return statement. Unlike in C, a function definition uses a null argument list, but requires (): function_name() { statements return value Optional }

shell function

Many programs use a loop to iterate through the program's arguments but without including the first argument. This argument could represent a directory, and the remaining could be ordinary filenames. We need "$@" here, but only after removing the first argu- ment and renumbering the remaining arguments. This is what _______ does. Each call to shift transfers the contents of a positional parameter to its immediate lower-numbered one. $2 becomes $1, $3 becomes $2, and so on. Note that shift also works with an integer argument; shift n shifts n words to the left.

shift

sed is mostly used for _____________ (s). The ___ flag at the end makes the substitution global. The search and substitution patterns can be regular expressions, but only of the BRE type.

substitution, g

The parameter $? stores the exit status of the last command. It has the value 0 if the command ____________ and a nonzero value if it fails. This parameter is set by exit's argument. If no exit status is specified, then $? is set to zero (true).

succeeds

When && is used to delimit two commands, cmd2 is executed only when cmd1 ____________.

succeeds

The __________ regular expression (TRE) is probably the most useful feature of sed. Using it, you can form groups in a line and then extract these groups. The TRE requires two regular expressions to be specified—one each for the source and target patterns

tagged

The if conditional can't handle relational tests directly, but only with the assistance of the ______ statement. test uses certain operators to evaluate the condition on its right and returns an exit status, which is then used by if for making decisions. test works as a frontend to if in three ways: • Compares two numbers (like test $x -gt $y). • Compares two strings or a single one for a null value (like test $x = $y). • Checks a file's attributes (like test -f $file).

test

if requires a _____ and is closed with a fi.

then

Shell scripts terminate when the interrupt key is pressed unless you use the _______ statement to specify a different action. trap is a signal handler, and it is normally placed at the beginning of a script. trap uses two lists: trap 'command_list' signal_list

trap

Apart from for, the shell also supports a ________ loop. This construct also uses the key- words do and done but doesn't work with a list. It uses a control command to determine the flow of execution: while condition is true do commands done

while

As in case, the list can come from anywhere. It can come from variables and _______ _________ for var in $PATH $HOME $MAIL From variables for file in *.htm *.html From all HTML files

wild cards

Special parameter used by the shell: Each quoted string treated as a separate argument (recommended over $*)

"$@"

Special parameter used by the shell that is set to the number of arguments specified. This lets you design scripts that check whether the right number of arguments have been entered.

$#

Special parameter used by the shell: Number of arguments specified in command line

$#

Special parameter used by the shell that holds the script filename itself. You can link a shell script to be invoked by more than one name. The script logic can check $0 to behave differently depending on the name by which it is invoked.

$0

Special parameter used by the shell: Name of executed command

$0

The numerical comparison operators used by test have a form different from what you would have seen anywhere. They always begin with a ___, followed by a two-character word, and enclosed on either side by whitespace. Here's a typical operator: -ne Not equal

-

Like perl and the system call library, test can be used to test practically all file attributes stored in the inode using operators that begin with -. For instance, the ____ operator tests for the existence of a file, and ____ does the same for a directory: $ [ -f /etc/passwd ] && echo "This file always exists" This file always exists $ [ -d foobar ] || echo "Directory foobar doesn't exist" Directory foobar doesn't exist

-f, -d

Numerical operator for greater than or equal to

-ge

Numerical operator for less than

-lt

Let's now consider an error-detection feature that benefits document authors—using grep this time. The TRE raises the possibility of detecting words that are inadvertently repeated—like the the. Since the TRE remembers a grouped pattern, you can look for these repeated words like this: $ grep "\([a-z][a-z][a-z]*\) *\__" note Two spaces before * You search search for a pattern with grep. sed sed can perform substitution too. But the grand-daddy of them all is perl perl. Each line here contains consecutive instances of a word (search, sed and perl). What does this pattern group match? A word containing at least two lowercase letters. This group is followed by one or more spaces (two spaces before the second *) and the repeated pattern.

1

Forms of the if conditional

1) if command is successful then execute commands fi 2) if command is successful then execute commands else execute commands fi 3) if command is successful then execute commands elif command is successful then... else... fi

A sed instruction comprises an __________ and an ___________ (command). Lines can be addressed by line numbers or context. The -n option makes sure that lines are not printed twice when using the p command. Lines can be inserted (i), appended (a), changed (c), and deleted (d).

address, action

UNIX-C programmers often need to copy data from one memory location to another. The _______ library function, which requires three arguments, is used in this manner: bcopy(hp->h_addr, &name.sin_addr, hp->h_length);

bcopy

The interval regular expression (IRE) uses a single or a pair of numbers surrounded by escaped curly braces—like _________. The expression signifies that ch can occur between m and n times.

ch\{m,n\}

The second form of addressing lets you specify a pattern (or two) rather than line numbers. This is known as ___________ ___________ where the pattern has a / on either side. You can locate the senders from your mailbox ($HOME/mbox) in this way: $ sed -n '/From: /p' $HOME/mbox

context addressing

In the first form, address specifies either one line number to select a single line or a set of two (3,7) to select a group of ____________ lines.

contiguous

You can also specify a comma-separated pair of context addresses to select a group of __________ lines. What is more, line and context addresses can also be mixed: sed -n '/johnson/,/lightfoot/p' emp.lst sed -n '1,/woodcock/p' emp.lst

contiguous

sed accepts multiple instructions (-___) to work on different sections of its input and to save the edited sections to separate files (w).

e

This is how the TRE works. Identify the segments of a line that you wish to extract, and enclose each segment with a matched pair of ____________ parentheses. For instance, to have a number as a group, represent that number as \([0-9]*\). A series of nonalphabetic characters can be represented as \([^a-zA-Z]*\). Every grouped pattern automatically acquires the numeric label ___, where n signifies the nth group from the left.

escaped, n

The IRE uses an escaped pair of curly braces and takes three forms: - ch\{m\}—The ___________ ch can occur m times. - ch\{m,n\}—Here, ch can occur between m and n times. - ch\{m,\}—Here, ch can occur at least m times.

metacharacter

Note that you must provide whitespace around the operators (like -eq), their operands (like $x), and inside the [ and ]. The second form is easier to handle and will be used henceforth. Programmers must note that [ is a shell builtin and is executed as a com- mand, so _____ is not a valid command!

[$x

The ___________ __________ _____________ (TRE)—groups patterns with ( and ) and represents them at the destination with numbered tags.

tagged regular expression

Irrespective of the way you select lines (by line or context addressing), you can use the ___ (write) command to write the selected lines to a separate file. You can save the lines contained within the <FORM> and </FORM> tags in a separate file: sed '/<FORM>/,/<\/FORM>/w forms.html' pricelist.html

w

test can be used to compare strings with yet another set of operators. ___________ is performed with = (not ==) and inequality with the C-type operator !=.

Equality

The _________ component is drawn from sed's family of internal commands (Table 10.4). It can either be a simple display (print) or an editing function like insertion, deletion, or substitution of text.

action

The test s1 == s2 is true if...

String s1 = s2 (Korn and Bash only)

The test s1 != s2 is true if...

String s1 is not equal to s2

The test -z stg is true if...

String stg is a null string

The test stg is true if...

String stg is assigned and not null

The test -n stg is true if...

String stg is not a null string

______________ is easily the most important feature of sed, and this is one job that sed does exceedingly well. It lets you replace a pattern in its input with something else. The use of regular expressions enhances our pattern matching capabilities, and in this chapter we feature some more regular expression characters that make the use of sed so compelling. You have encountered the substitution syntax in vi before (5.14): [address]s/expression1/expression2/flags

Substitution

A single read statement can be used with one or more variables to let you enter multiple words: read pname flname Note that when the number of words keyed in __________ the number of variables, the remaining words are assigned to the last variable. To assign multiple words to a single variable, quote the string.

exceeds

A shell script needs to have __________ permission when invoked by its name. It is not compiled to a separate executable file as a C program is. It runs in _____________ mode and in a separate child process. The calling process (often, the login shell) forks a sub-shell, which reads the script file and loads each statement into memory when it is to be executed.

execute, interpretive

The if and while constructs implicitly check $? to control the flow of execution. As a programmer, you should also place _____ statements with meaningful exit values at appropriate points in a script.

exit

All programs and shell scripts return a value called the _____ _______ to the caller, often the shell. The shell waits for a command to complete execution and then picks up this value from the process table. Shell scripts return the exit status with the exit statement

exit status

If you don't provide the she-bang line, the login shell will spawn a child of its own type to run the script—which may not be the shell you want. You can also __________ spawn a shell of your choice by running the program representing the shell with the script name as argument: bash script.sh Will spawn a Bash shell When used in this way, the Bash sub-shell opens the file but ignores the interpreter line. The script doesn't need to have execute permission, either. We'll make it a practice to use the she-bang line in all of our scripts.

explicitly

The || operator does the opposite; the second command is executed only when the first ________

fails

Test '-s file' is true if...

file exists and has a size greater than zero

Test '-d file' is true if...

file exists and is a directory

Test '-f file' is true if...

file exists and is a regular file

Test '-x file' is true if...

file exists and is executable

Test '-r file' is true if...

file exists and is readable

Test '-w file' is true if...

file exists and is writable

$ sed 's/\([a-z]*\) *\([a-z]*\)/\2, \1/' teledir.txt | sort dylan, robert 9632454090 harris, charles 98310200987 johnson, bill 327-100-2345 lightfoot, gordon 345-987-4670 wood, barry 234-908-3456 woodcock, john 2344987665 The first group, \([a-z]*\), represents zero or more occurrences of alphabetic characters; this effectively captures the ____ name. An identical pattern takes care of the ____________. These two groups are separated by zero or more occurrences of space ( *). In the target pattern, we re-create these groups but in reverse sequence with the tags \2 and \1.

first, surname

It's viable; we simply need to reverse the first and second arguments. This is easily done by forming two groups representing the two arguments. Each group is represented by multiple instances of a ______________ character followed by a comma. Let sed read the standard input this time: $ echo "bcopy(hp->h_addr, &name.sin_addr, hp->h_length);" | > sed 's/bcopy(\([^,]*,\)\([^,]*,\)/memcpy(\2\1/'memcpy( &name.sin_addr,hp->h_addr, hp->h_length);

noncomma

The address and action are enclosed within single quotes. Addressing in sed is done in two ways: - By one or two line __________ (like 3,7). - By specifying a /-enclosed pattern which occurs in a line (like /From:/).

numbers

Scripts not using read can run noninteractively and be used with redirection and pipe- lines. Like UNIX commands (which are written in C), such scripts take user input from command-line arguments. They are assigned to certain special "variables," better known as ___________ ____________. The first argument is available in $1, the second in $2, and so on.

positional parameters


Ensembles d'études connexes

ABEKA WORLD HISTORY AND CULTURES APPENDIX QUIZ S

View Set

Information Security Fundamentals Chapter 4

View Set

Midterm-Public Speaking-Notes/Quiz/Review?

View Set