subject

The shell expands $0 to the name of the calling program (sobell, page 461), $1–$n to the individual command-line arguments (positional parameters; sobell, page 462), $* (sobell, page 465) to all positional parameters, and $# (sobell, page 466) to the number of positional parameters.1. write a script named all that displays (sends to standard output) the name of the calling program, the number of positional parameters, and a list of positional parameters. include the #! line (sobell, page 287) and a comment (sobell, page 288). remember to make the file executable (sobell, page 100). test the script with 0, 1, and 5 positional parameters.2. make a symbolic link (sobell, page 113) named linkto to the all script you wrote in the previous step. call linkto with two arguments. what does the script report as the name it was called as? 3. write a script named myname that uses echo (most of the examples in chap- ter 10 use this utility) to prompt the user with enter your name: , reads into a variable the string the user types in response to the prompt, and then dis- plays hello followed by the string the user typed. when you run the program it should look like this: $ ./myname enter your name: max wild hello max wild4. rewrite myname from the previous step, calling it myname2. have this version of the program prompt the user for a string, but instead of displaying hello and the string on the screen (sending it to standard output) redirect the output so the program writes only the string the user entered (and not hello) to the temporary file named pid. name where pid is the process id number (sobell, page 467) of the process running the script. display the contents of the pid. name file.5. write and run a script named looper that uses the for (sobell, page 434) control structure to loop through the command-line arguments and display each argument on a separate line.6. rewrite looper from the previous step, calling it looper2. have this version of the program use the control structure (sobell, page 432) to perform the same task.7. write a script named ifthen that prompts the user with > > and reads a string of text from the user. if the user enters a nonnull string, the script displays you entered: followed by the string; otherwise it displays where is your input? . use an control structure (sobell, page 424) to imple- ment the two-way branch in the script. use the test (sobell, pages 420 and 978) builtin to determine if the user enters a null string. what do you have to do to avoid getting an error message when you prompt with > > ? (there are several ways to construct the test statement.)8. write and run a simple shell script named echomyvar that displays the pid (sobell, page 467) of the process running the script and value of the variable named myvar. display the pid of the interactive shell you are working with. what is the value of the variable within the process running the shell script? are the interactive shell and the shell running the script run by the same or different processes (do they have the same pid)?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. after the loop terminates, it prints out, on a line by itself and separated by spaces, the sum of all the even integers read, the sum of all the odd integers read, a count of the number of even integers read, and a count of the number of odd integers read, all separated by at least one space. declare any variables that are needed. assume the availability of a variable, stdin, that references a scanner object associated with standard input. that is, stdin = new scanner(system.in); is given.
Answers: 3
question
Computers and Technology, 23.06.2019 04:20
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy.a. a fire occurs on the premises, and the building isbadly damaged.b. a burglar steals some money and securities from anunlocked safe.c. a business computer is damaged by vandals whobreak into the shop after business hours.d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm.til
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
The basic work area of the computer is it screen that you when you first fire up your computer
Answers: 1
You know the right answer?
The shell expands $0 to the name of the calling program (sobell, page 461), $1–$n to the individual...
Questions
question
Mathematics, 02.02.2021 04:20
question
Mathematics, 02.02.2021 04:20
question
Mathematics, 02.02.2021 04:20
question
Computers and Technology, 02.02.2021 04:20
Questions on the website: 13722363