should result in the script displaying 4 since there are four words in the invocation
Write a script that lets users specify echo and wc command sequences, allowing them to use the word "pipe" to represent a pipe symbol. So input like:
echo this is a test pipe wc -w
should result in the script displaying 4 since there are four words in the invocation.
There are various ways to solve this with loops, but the easiest and fastest solution is simply to use the sed command to replace pipe with the pipe symbol. But students need to be careful that they don't get overzealous and change words like "repiped", hence the regular expression:
newcmd=$( echo $@ | sed 's/[^a-zA-Z0-9]pipe[^a-zA-Z0-9]/ | /g' )
eval $newcmd
You might also like to view...
The async modifier indicates that a method or ________ expression contains at least one await expression.
a) attribute b) lambda c) property d) iterator
A data macro is managed while you are viewing a table in ________ view
A) Layout B) Design C) Datasheet D) Print Preview
In Excel Online, the Share Survey feature creates a link providing access to a web form without giving the end users access to the collected results
Indicate whether the statement is true or false
Critique the statement that it is possible to define a single software product metric for any system.
What will be an ideal response?