Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I need help in Unix Programming. Thank you 1: What will be matched by the following regular expressions? x* [0-9]{3} xx* [0-9]{3,5} x{1,5} [0-9]{1,3},[0-9]{3}

Please I need help in Unix Programming. Thank you

1: What will be matched by the following regular expressions? x*

[0-9]\{3\}

xx*

[0-9]\{3,5\}

x\{1,5\}

[0-9]\{1,3\},[0-9]\{3\}

x\{5,\}

^\...

x\{10\}

[A-Za-z_][A-Za-z_0-9]*

[0-9]

\([A-Za-z0-9]\{1,\}\)\1

[0-9]*

^Begin$

[0-9][0-9][0-9]

^\(.\).*\1$

2: What will be the effect of the following commands? who | grep 'mary'

who | grep '^mary'

grep '[Uu]nix' ch?/*

ls -l | sort +4n

sed '/^$/d' text > text.out

sed 's/\([Uu]nix\)/\1(TM)/g' text > text.out

date | cut -c12-16

date | cut -c5-11,25- | sed 's/\([0-9]\{1,2\}\)/\1,/'

3: Write the commands to a. Find all logged-in users with usernames of at least four characters. b. Find all users on your system whose user ids are greater than 99. c. Find the number of users on your system whose user ids are greater than 99. d. List all the files in your directory in decreasing order of file size.

4.Create a shell program called time from the following command line:

banner `date | cut -c12-19` 

5.Write a shell program that gives only the date in a banner display. Be careful not to give your program the same name as a SCO OpenServer system command.

6.Write a shell program that sends a note to several people on your system.

7.Redirect the date command without the time into a file.

8.Echo the phrase ``Dear colleague'' in the same file as the previous exercise, without erasing the date.

9.Using the above exercises, write a shell program that sends a memo to the same people on your system mentioned in Exercise 2-3. Include in your memo:

lines at the top that include the current date and the words ``Dear colleague''

the body of the memo (stored in an existing file)

a closing statement

10.How can you read variables into the mv.file program? (create mv.file)

11.Use a for loop to move a list of files in the current directory to another directory. How can you move all your files to another directory?

12.How can you change the program search, so that it searches through several files? (you can create the program search)

Hint:

for file in $*

13.Set the stty options for your environment.

14.Change your prompt to the word Hello.

15.Check the settings of the variables $HOME, $TERM, and $PATH in your environment.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions