Question

UNIX?LINUX course. You are working on a documentation file userNotes.txt with some members of your software...

UNIX?LINUX course.

You are working on a documentation file userNotes.txt with some members of your software development team. Just before the file needs to be submitted, you manager tells you that a company standard requires that one blank space be left between the end-of-sentence period (.) and the start of the next sentence. (This rule does not affect sentences at the very end of a line.) For example, this is OK: Turn the knob. Push the “on” button. This is not: Turn the knob. Push the “on” button. Asking around among your team members, you discover that some of them have already typed their sentences in the approved manner, but others have inserted two or even more blanks between sentences. You need to fix this fast, and the first thing you want to do is to find out how bad the problem is. What command would you give to list all lines of userNotes.txt that contain sentence endings with two or more blanks before the start of the next sentence?

ANSWER SHOULD BE A GREP COMMAND WITH NO FLAGS.

I have tried (grep '. +' userNotes.txt ) but it does not work.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

To get solution for this query, we are assuming the line is ending with alphanumeric character(either alphabet or digits) and using grep without any flags

Space in regex is represented as [ ], \\s

We are taking \\s and taking count as more than 2(sentance that ends with more than 2 spaces and period(.)

With below command in first block[], We took uppercase,lowercase alphabets and digits using the regex

-) [a-zA-Z0-9]

-) Followed by \\s counting more than 2

\\s\{2,\}

-) Period is represented by .

-) End of the sentance is represented by $

grep "[a-zA-Z0-9]\\s\{2,\}.$" testing.txt

testing.txt content

hello this isl. this is the way . not the things you carry but you need to worry. life is like that9 . but no matter what. JKOutput using above command

codebuzz > grep [a-zA-Z0-9]\\s\{2, 1}.$ testing.txt not the things you carry JKSDFUSHDFGJ kjsdhfuiwhsfekwenkudfg

Note: If you like my answer,please review with thumbsup

Add a comment
Know the answer?
Add Answer to:
UNIX?LINUX course. You are working on a documentation file userNotes.txt with some members of your software...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am taking an introductory course in unix/linux shell programming and need some help. Can you...

    I am taking an introductory course in unix/linux shell programming and need some help. Can you tell me what command I would use to make the variable myName readable by child process

  • In unix/Linux Assume you have a subdirectory named dotofiles directly under your current working directory, and...

    In unix/Linux Assume you have a subdirectory named dotofiles directly under your current working directory, and you have two files nomed datol and dotaz in your current directory. What command can you use to copy the data and dotaz files from your current working directory to the datafiles directory? TTT Artal 3120 T.... 5 BE36 Pantep Words: 0

  • Using Unix processes Submit a README file that lists the files you have submitted along with...

    Using Unix processes Submit a README file that lists the files you have submitted along with a one sentence explanation. Call it Prj1README. MakeCopy.c : Write a C program that makes a new copy of an existing file using system calls for file manipulation. The names of the two files and copy block sizes are to be specified as command line arguments. Open the source file in read only mode and destination file in read/write mode. ForkCopy.c : Write a...

  • In Unix/Linux, input and output are treated as files and referenced by the operating system using file descriptors. When you open a shell session, for example, three file descriptors are in use: 0 st...

    In Unix/Linux, input and output are treated as files and referenced by the operating system using file descriptors. When you open a shell session, for example, three file descriptors are in use: 0 standard input (stdin) 1 standard output (stdout) 2 standard error (stderr) By default, the command interpreter (shell) reads keyboard input from file descriptor 0 (stdin) and writes output to file descriptor 1 (stdout), which appears on the screen. As you explored in Lab 2, input/output can be...

  • Project 4-3: In the following steps, you will learn more about the PING (Packet Internet Grouper)...

    Project 4-3: In the following steps, you will learn more about the PING (Packet Internet Grouper) utility, which can be used on a network running IPv4 to verify that TCP/IP is configured correctly and communicating with the network. A ping test is typically the first thing network professionals try when troubleshooting a TCP/IP connection problem. For this project, you can use any type of workstation that's running TCP/IPv4, preferably one connected to the Internet. The output described in the following...

  • For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java...

    For this assignment, you will use your knowledge of arrays and ArrayLists to write a Java program that will input a file of sentences and output a report showing the tokens and shingles (defined below) for each sentence. Templates are provided below for implementing the program as two separate files: a test driver class containing the main() method, and a sentence utilities class that computes the tokens and shingles, and reports their values. The test driver template already implements accepting...

  • Question 2 0/1 point (graded) What happens when you remove a directory using the command rm...

    Question 2 0/1 point (graded) What happens when you remove a directory using the command rm -r? You cannot remove a directory using the rm command. You permanently remove the entire directory, including all files and subdirectories. You move the entire directory to a trash folder, but it can be restored later. You get a warning message asking if you want to proceed, then you delete the directory. incorrect Answer Incorrect: Try again. Unix does not warn you before permanently...

  • This assignment should give you experience in using file descriptors, open(), close(), write(), stat() and chmod(),...

    This assignment should give you experience in using file descriptors, open(), close(), write(), stat() and chmod(), perror(), and command line arguments. Program: Write a C++ program that will allow you to add messages to a file that has NO permissions for any user. A Unix system has many files that have sensitive information in them. Permissions help keep these files secure. Some files can be publicly read, but can not be altered by a regular user (ex.: /etc/passwd). Other files...

  • PRE-LAB 3: Acceleration and Force 1. (3pts) In Part 1, you will repeat your Lab 2...

    PRE-LAB 3: Acceleration and Force 1. (3pts) In Part 1, you will repeat your Lab 2 Speeding Up experiment with a focus on forces. . Draw a free-body diagram of the forces acting a. on the cart. otes Draw a free-body diagram of the forces acting on the mass. b. Which forces in the two diagrams are equal? c. oipol 3. (4 pts) We will be using the same cart and motion sensor setup we used in last lab: Force...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT