Question

linux regular expressions: file name: lab3test.txt Create regular expressions that meet the following criteria. You may...

linux regular expressions:

file name: lab3test.txt

Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions

1.Match only the lines that contain an employee ID (and nothing else) with the format 12345.

Homework Answers

Answer #1
A Regular expression followed by {m} matches exactly m occurrences of the preceding expression. The following grep command will display only the number which has 5 digits.

grep "^[0-9]\{5\}$" lab3test.txt

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and i can edit and change the answers if you argue, thanks :)

Know the answer?
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
Similar Questions
linux regular expression file name: lab3test.txt Create regular expressions that meet the following criteria. You may...
linux regular expression file name: lab3test.txt Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions. 1.Write a SED command that could replace all of the area codes that use parenthesis so that they are removed and replaced with a single dash like the others. Example: (222) 222-2222 should become 222-222-2222.
linux Regular expressions file name: lab3test.txt Employee ID Full Name Phone Age =========== ========= ===== ===...
linux Regular expressions file name: lab3test.txt Employee ID Full Name Phone Age =========== ========= ===== === 12564 Carol, Tara (222) 555-1231 44 45321 45612 Knotts, Don 78 29878 Evans, Bob (222) 341-4311 32122 Smith, 29 41221 Id, Bill 222-231-2322 33 41231 23121 Lemon, Jay 222-321-43 23341 Aaron, John 222-555-7321 34 12564 Carol, Tara (222) 555-1231 44 45321 Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions. 1.Display all lines where the...
Linux: Regular Expressions file name is studentsyslog.txt Use a regular expression and grep or egrep to...
Linux: Regular Expressions file name is studentsyslog.txt Use a regular expression and grep or egrep to filter the file so the output displays only the items requested. Put your full command in the space provided. Display only the lines which contain the word CUPS
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2....
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2. Create a file with name “yourLastName.txt” inside the directory created in step.1 3. Write inside the created file exactly the following content (you may use editors such as vim, pico, ….): Linux Lab Lab. ToDo#1 Summer Semester 2019/2020# 4. Display the first 2 lines of the file. 5. Change the permission of the file to read write and execute for owner, groups and others....
Write regular expressions that will match IP addresses and usernames in a Microsoft IIS log file....
Write regular expressions that will match IP addresses and usernames in a Microsoft IIS log file. First, you will write a regular expression that matches IP addresses within the re.compile function call on line 36. Next, you will write a regular expression that matches usernames (in the format domain\username) on line 50. Finally, in steps 3 and 4 you will write a loop for each step that displays all the IP addresses (gathered into the list ipAddresses) and usernames (gathered...
Create a header file (lastname_employeerec.h) that defines an employee data structure (sEMPLOYEE) that can be linked...
Create a header file (lastname_employeerec.h) that defines an employee data structure (sEMPLOYEE) that can be linked onto a linked list. The data structure should have the following fields: a. First Name (firstName) b. Last Name (lastName) c. Employee ID (id) d. Start Year (startYear) e. Starting Salary (startSalary) f. Current Salary (currentSalary) g. next Create a library of functions that operate on this data structure. The source code for the functions should be in lastname_employeerec.c and the function prototypes should...
Could you script in Matlab : Script Name General Algorithm AddNewEmployee Display all of the ID...
Could you script in Matlab : Script Name General Algorithm AddNewEmployee Display all of the ID numbers currently in use Read in a new ID number If the ID number read in is already in use Report this fact End this script Else (this is a new ID number) Read in: Years with the company Salary Vacation days Sick days Add this new employee to the database (by appending a new row to the end of the EmployeeData matrix) Note...
IN LINUX answer the following with what you would type to get the desired result. Change...
IN LINUX answer the following with what you would type to get the desired result. Change the permissions of the /home/shared/salesproject/ folder itself, allowing the owner and group full access, with no access for anyone else on the system. Log in as "susan" (password "secret") and make sure she can access the /home/shared/salesproject/ directory and files within. Create a file in /home/shared/salesproject/ as susan. What are the owner, group, and mode of the file she created? Log in as "sam"...
Create the following class in C++ Create a new class call Date. Date will contain the...
Create the following class in C++ Create a new class call Date. Date will contain the date stored as day of the month, month and the year. Provide appropriate set and get methods for the class. Use doxygen comments to document Date.h (Date specification). Think about how the class will be used. Modify the input data file to cater for dates. The date in the data file refers to when the mark for the unit was obtained. Unit test the...
Create a C Program called Summer_Heat that meets the following criteria: Lines 1,2: Identifies the name...
Create a C Program called Summer_Heat that meets the following criteria: Lines 1,2: Identifies the name of Program that the Programmer Lines 4,5: Includes the header files to allow input and output and use the system commands Line 7: Includes Declarations comment Line 8: Declares counter as an integer with an initial value of 0 Line 9: Initializes a double array called temperature using a single statement and the following 10 values 78.6 82.1 79.5 75.0 75.4 71.8 73.3 69.5...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT