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
Suppose you are given a data set consisting of nominal attributes, such as color, which takes values such as red, blue, green et
Ratling [72]

Answer:

No, you can´t.

Explanation:

An SVM uses a binary system. In this case the data consists of nominal attributes which can´t be used directly into the SVM.

However, in order to transform this normal attribute into the binary system is necessary to order the information in two sequences, in which the colors are based into two information facts that will give the system the representation that needs.

3 0
4 years ago
Xavier would like to change the sort options for his contacts. In which tab will he find the Arrangement command group?
sesenic [268]

If this is in regards to Microsoft outlook

Answer would be the View tab.

3 0
3 years ago
What do we call notes in computer code for the programmer that are ignored by the compiler?.
Lelu [443]

The notes in computer code for the programmer that are ignored by the compiler is called a comment.

<h3>What are codes in programming?</h3>

Codes in programming are specific sequences or sets of instructions that are made for specific programs. They are written in a specific language. They are made to make a human-friendly language. Codes are made after the compiler confirms them.

Comments are written for the document. They tell what the document is for, and how the document is constructed.

Thus, the notes on the computer code for the programmer are called a comment.

To learn more about comments in computer code, refer to the link:

brainly.com/question/18340665

#SPJ4

4 0
2 years ago
Impact of information technology in the society​
GarryVolchara [31]

Answer:

led to exposure of dangerous things

3 0
3 years ago
The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
san4es73 [151]

True

Excel 2019 makes it easy to remove conditional formatting since users do not need to highlight data in order to remove it.

5 0
4 years ago
Other questions:
  • Two different names that refer to the same data item best defines:
    12·1 answer
  • . A register in a computer has a of bits. How many unique combinations can be stored in the register?
    5·1 answer
  • Your friend sees an error message during Windows startup about a corrupted bootmgr file. He has another computer with a matching
    12·1 answer
  • What is the process of comparing data with a set of rules or values to find out if the data is correct?
    8·2 answers
  • A common technique for masking contents of messages or other information traffic so that opponents can not extract the informati
    14·1 answer
  • Assign jsonData with the parsed value of the stringData variable. Then, assign 29 to the points property in jsonData and assign
    13·1 answer
  • Assume we are testing a variable is_sunny in a while loop. is_sunny = “n”.
    13·1 answer
  • A ________ is a single media file including art, sound, animation, or movies.
    9·1 answer
  • lance has three tables in his database. He wants to generate a report to show data from the three tables. Therefore, he decides
    7·2 answers
  • Please answer soon
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!