Need Urgent Help with 2 Projects

Reply

Join Date: Nov 2005
Posts: 2
Reputation: Wolfy is an unknown quantity at this point 
Solved Threads: 0
Wolfy Wolfy is offline Offline
Newbie Poster

Need Urgent Help with 2 Projects

 
0
  #1
Nov 17th, 2005
I have these two projects due tomorrow for extra credit in my Unix class and I have no idea how to write them. I really need the extra credit to bump my grade up a little. Any help would be greatly appreciated. Here are the descriptions:

Project One: A) Create a shell script called "add_listing" that prompts the user to enter a line of text and then appends it to the end of a file called "pbook"
B)Create a shell script called "find_listing" that prompts the user to enter a search string and then displays all lines from the "pbook" file that contain the entered string. The output should be stored.
C)Combine the above two scripts into a single script that will accomplish both of the above tasks depending on how it's invoked.

Project Two: A)Create a shell script that recieves the name of a directory as its argument and searches for any zero-length files within that directory. The script should display the names of these files.
B)Modify the above script to search not only the directory, but any sub-directories (and sub-sub-directories) as well.
C)Modify the above script to prompt the user for each file, asking if they wish to delete the file. The permissable responses should be 'Y', 'y', 'N' or 'n'. If 'Y' or 'y' delete the file. Otherwise, leave the file in place.

I have tried to do these over the past day or so but I haven't gotten them to work. If someone could help quick that'd be great. Thanks!
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Need Urgent Help with 2 Projects

 
0
  #2
Nov 17th, 2005
And what exactly have you done, and where/why doesn't it work?
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 2
Reputation: Wolfy is an unknown quantity at this point 
Solved Threads: 0
Wolfy Wolfy is offline Offline
Newbie Poster

Re: Need Urgent Help with 2 Projects

 
0
  #3
Nov 18th, 2005
Just a skeleton outline of the scripts would be helpful because I really don't know where to start besides #/bin/sh at the top...lol. I've read chapters 10 and 11 in my book but I'm still having problems. Like I said, it's extra credit, so we didn't go over how to do it in class. Please help quickly...Thanks!
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 178
Reputation: jim mcnamara is on a distinguished road 
Solved Threads: 10
jim mcnamara jim mcnamara is offline Offline
Junior Poster

Re: Need Urgent Help with 2 Projects

 
0
  #4
Nov 18th, 2005
echo "some prompt" - displays a prompt
read variablename - reads input from the terminal
echo "$variablename" >> filename - appends a line

Now you put them together.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC