automation scripts--help needed urgent

Reply

Join Date: Nov 2009
Posts: 15
Reputation: whizkidash is an unknown quantity at this point 
Solved Threads: 0
whizkidash's Avatar
whizkidash whizkidash is offline Offline
Newbie Poster

automation scripts--help needed urgent

 
0
  #1
16 Days Ago
Hi team,

Well i have been asked to make use of automation scripts for my host production box.. .And i hope u will help me with the same.

#script as below:
a)when i run script it should ask the person to key in..(means should be interactive)
b) it should search a file
c) it should replace a word/ multiple word in a file and prompt user for more changes once he done with
and finally..
D) delete the line rows... (any rows- mentioned by the user on files)

I am done with the 1st script but i am having probs with the second and third

2)I knw sed will replace
Shell Scripting Syntax (Toggle Plain Text)
  1. sed 's/(word)/(with-word)'/ file name

3)and sed 'line,lined' file

but how to use in the below script and ask the user for more inputs..
Please provide me with the earliest..
thankin you once again

PS: Moderator pls dont treat this mail as repetative

regards
whizkidash




Shell Scripting Syntax (Toggle Plain Text)
  1. vi showme.sh(script name)
  2.  
  3. echo "type the file to be search"
  4. read fname
  5. if ls -lart | $fname
  6. then
  7. echo " File exist"
  8. else echo " File fail"
  9. ------(uptil here it run fine)
  10. echo " type the file to be replace/or substituted"
  11. read tname
Last edited by peter_budo; 15 Days Ago at 5:34 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Reply With Quote Quick reply to this message  
Reply

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