1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dahasolnce [82]
3 years ago
12

Write commands to carry out the following commands: a) Print all lines containing the string John. b) Print all lines where a wo

rd starts with J. c) Print all lines ending with word stopped. d) Print all lines that don't contain was. e) Print lines where a word begins with K or k. 2. Write a bash script that copies all files of the current directory into a new sub-directory, and then deletes the created sub-directory along with its contents and displays a message that indicates completion of the task. 3. Write a bash script that reads two numbers x and y and performs addition, subtraction, multiplication, and division of the two numbers (x y, x-y, x*y, x/y) and prints out each of these values along with some text to indicate what these numbers are.
Computers and Technology
1 answer:
egoroff_w [7]3 years ago
3 0

Answer:

see explaination

Explanation:

1.

1. grep 'John' FileName

2. grep '^\J' FileName

3. grep 'stopped$' FileName

4. grep -v -e 'was' FileName

5. grep -E '^(k|K)' FileName

2.

#print the message to create subdirectory

echo "Creating a subdirectory to copy current directory files into named 'sub'"

#create subdirectory

mkdir sub

echo "Directory successfully created"

#Copy the files in the current working directory to created subdirectory

echo "Copying files of current directory into newly created subdirectory"

rsync -a --exclude='sub' * sub

#display the message to copy the files

echo "Copying operation completed successfully"

echo "Now deleting the created subdirectory along with its contents"

rm -rf sub

#indicated the message completion of task

echo "Operation completed successfully."

3.

#prompt and read the first number

echo "Enter the first number: "

read x

echo "Enter the second number: "

read y

#Compute arithmetic operations and store in the

#respective variable

addition=$(($x + $y))

subtraction=$(($x - $y))

multiplication=$(($x * $y))

division=$(($x / $y))

#print the values

echo "Addition of $x and $y is $addition"

echo "Subtraction of $x and $y is $subtraction"

echo "Multiplication of $x and $y is $multiplication"

echo "Division of $x and $y is $division"

You might be interested in
Define
3241004551 [841]

Computational thinking- the thought processes involved in formulating a problem and expressing its solution(s) in such a way that a computer—human or machine—can effectively carry out. Computational Thinking is an iterative process based on three stages.

Problem solving process- The process of working through details of a problem to reach a solution. Problem solving may include mathematical or systematic operations and can be a gauge of an individual's critical thinking skills.

Data- facts and statistics collected together for reference or analysis.

Information- facts provided or learned about something or someone.

Algorithm- a process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.

Aggregate data- aggregate data are data combined from several measurements. When data are aggregated, groups of observations are replaced with summary statistics based on those observations. In a data warehouse, the use of aggregate data dramatically reduces the time to query large sets of data.

Discovery Data- in the context of IT, is the process of extracting actionable patterns from data. The extraction is generally performed by humans or, in certain cases, by artificial intelligence systems.



3 0
3 years ago
How can I convert a string to a int? in Java
Deffense [45]

Answer:

int

Explanation:

5 0
2 years ago
The concurrent process model defines a set of "states." describe what these states represent in your own words, and then indicat
nikitadnepr [17]

Answer:

Explanation:

Concurrent Process model can be regarded as evolutionary process model as well as software engineering is concerned, it allows to know the current state of activities as well as their associated states.

The set of states In the concurrent process model are:

✓awaiting changes

✓Inactive

✓baselined

✓under development

✓under revision

✓under review

✓done

The stated "states" above give a representation of externally observable mode as regards to the behaviour of activities of a particular software engineering.

The existence of activities of software engineering do exist at same period

In concurrent process model, though each of the activities occur in different states so that process network is produced. The movement from one state to another of activity of software engineering is as a result of

predefined events.

5 0
3 years ago
Virus infections often disable antivirus programs and prevent them from being enabled
SCORPION-xisa [38]
Some of the advanced viruses do this. So it would be true.
3 0
3 years ago
Direction. See
storchak [24]

Answer:

1.A

2.A

3.B

4.A

5.D

6.A

..............

8 0
3 years ago
Other questions:
  • Write a program to read as many test scores as the user wants from the keyboard (assuming at most 50 scores). Print the scores i
    13·1 answer
  • What is computer? Explain the characteristics of computer.<br>​
    12·1 answer
  • Using a loop, write a program that reads in exactly five integers and outputs the sum.
    11·1 answer
  • In excel what does sidney need to consider when creating formulas
    7·1 answer
  • Which of the following is an anxiety disorder
    5·2 answers
  • What do newly PivotTables look like?
    9·1 answer
  • Gary has to complete a form before enrolling into an online course. A few of the fields require Gary to respond with either a "Y
    7·2 answers
  • What is another name for mesolithic age
    7·2 answers
  • What is an infrastructure dedicated to one organization
    13·1 answer
  • ____ is a technique for confirming that q received packet or frame is likely to match what was sent
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!