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
Today car-buying customers can enter negotiation armed with accurate facts and figures about a car. Describe how car buyers felt
cluponka [151]
Since there was no internet back then, life was hard, the buyers had to pay more money, and it was very difficult. Nowadays it's different. People could just stay home go on the internet and choose a car, then the next day or a few more days, there car is right in their parking lot. Hoped this helps! :)
3 0
3 years ago
3 uses of a computer ​
GenaCL600 [577]

Answer:

online bills payment

watching movies or shows

home tutoring

3 0
2 years ago
Read 2 more answers
Consider a set of mobile computing clients in a certain town who each
poizon [28]

Answer: answer given in the explanation

Explanation:

We have n clients and k-base stations, say each client has to be connected to a base station that is located at a distance say 'r'. now the base stations doesn't have allocation for more than L clients.

To begin, let us produce a network which consists of edges and vertex

Network (N) = (V,E)

where V = [S, cl-l, - - - -  cl-n, bs-l - - - - - - bs-k, t]

given that cl-l, - - - - - cl-n represents nodes for the clients

also we have that bs-l, - - - - - bs-k represents the nodes for base station

Also

E = [ (s, cl-i), (cl-i,bs-j), (bs-j,t)]

(s, cl-i) = have capacity for all cl-i (clients)

(cl-i,bs-j) = have capacity for all cl-i  clients & bs-j (stations)

⇒ using Fond Fulkorson algorithm we  find the max flow in N

⇒ connecting cl-i clients to  bs-j stations

      like (cl-i, bs-j) = 1

   if f(cl-i, bs-j)  = 0

⇒ say any connection were to produce a valid flow, then

if cl-i (clients) connected                f(s,cl-i) = 1 (o otherwise)

if cl-i (clients) connected  to bs-j(stations)   f(cl-i,bs-j) = 1 (o otherwise)

   f(bs-j,t) = no of clients  (cl-i)  connected to bs-j

⇒ on each node, the max flow value (f) is longer than the no of clients that can be connected.

⇒ create the connection between the client and base station i.e. cl-l to base bs-j iff    f(cl-i, bs-j) = 1

⇒ when considering the capacity, we see that any client cannot directly connect to the base stations, and also the base stations cannot handle more than L clients, that is because the load allocated to the base statsion is L.

from this, we say f is the max no of clients (cl-i) that can be connected if we find the max flow, we can thus connect the client to the base stations easily.

cheers i hope this helps

5 0
3 years ago
Which of the following is used to allocate memory for the instance variables of an object of a class?1. the reserved word public
kodGreya [7K]

Answer:

The correct answer to the following question will be 2. the operator new.

Explanation:

New operator is used to allocating the memory to the instance object.The new object can be created by using a "new" keyword in java .

Syntax of using 'new' operator is :

class_name object_name=new class_name() // it allocated the memory to the class

For Example :

ABC obj = new ABC;  

Now, this time obj points to the object of the ABC class.

obj = new ABC ();

call the construction of ABC class

3 0
3 years ago
if you want to present slides to fellow students and co-workers which productivity software should you use to create them?
ladessa [460]

Answer:

Microsoft PowerPoint.

Explanation:

Because, it is industry standard and widely recognized and used in world.

8 0
2 years ago
Other questions:
  • Jana keeps receiving friend requests from strangers on a social media site. This is making her uncomfortable.
    15·2 answers
  • When possible, you should avoid using _________ variables in a program?
    11·1 answer
  • Please create C program, the task is to implement a function edoublepowerx that has an input parameter x of floating-point value
    11·1 answer
  • Encrypting text allows us to encrypt and decrypt the text using a special key.
    9·1 answer
  • Fill this blanks with the given words​
    6·1 answer
  • You are running your warehouse using Autonomous Data Warehouse (ADW) service and you noticed that a newly configured batch job i
    15·1 answer
  • Consider the following code segment, which is intended to simulate a random process. The code is intended to set the value of th
    13·1 answer
  • 11 Select the correct answer. Which external element groups items in a design?
    9·1 answer
  • NEED HELP QUICK!!!
    12·1 answer
  • What is HTML? Write some future of HTML.<br>follow for follow ​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!