subject

Write a perl script that processes the output of the echo $path shell command. this command displays the content of the
shell environment variable, $path. this variable contains a list of directory names. when you try to execute a command at
the command-line, the shell will look for the program file corresponding to that command in each of the directories listed in
the $path variable. your script should do the following:
1. execute the echo $path command. to execute a shell command in your perl script, see the example for the qx
quote operator on the "quoting operations" slides.
2. use a regex to extract the name of each directory in the output of the echo $path command.
3. print each directory name to stdout. print one directory per line.
note: you must use the m//g regular expression construct to extract all the directory names and store them in an array first.
here is an example to extract all integers in a string and store them in an array:
$s = "we had 3 clubs with 10 people each in 4 months.";
@arr = $s =~ /\d+/g;

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 21:00, lisamccray45
It is not a good idea in a cover letter to mention another person whom the employer knows.
Answers: 1
image
Computers and Technology, 22.06.2019 07:20, Hcalhoun21
Write a pseudocode solution for each of these problems. 1. design a while loop that lets that user enter a number. the number should be multiplied by 10, and the result stored in a variable named product. the loop should iterate as long as product contains a value less than 100. 2. design a do-while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed. the loop should ask the user whether he or she wishes to perform the operation again. if so, the loop should repeat; otherwise it should terminate. 3. design a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 100. 4. design a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row. 5. convert this for loop to a while loop. declare integer count for count = 1 to 50 display count end for 6. find the error in the following pseudocode. declare boolean finished = false declare integer value, cube while not finished display “enter a value to be cubed.” input value; set cube = value ^ 3 display value, “ cubed is “, cube end while
Answers: 2
image
Computers and Technology, 22.06.2019 21:00, daniella0123
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
image
Computers and Technology, 23.06.2019 19:30, bbgirl8638
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
You know the right answer?
Write a perl script that processes the output of the echo $path shell command. this command displays...

Questions in other subjects:

Konu
Mathematics, 31.08.2019 01:30
Konu
Mathematics, 31.08.2019 01:30
Konu
Mathematics, 31.08.2019 01:30
Konu
Mathematics, 31.08.2019 01:30