943,931 Members | Top Members by Rank

Ad:
Nov 7th, 2009
0

automation scripts--help needed urgent

Expand Post »
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; Nov 7th, 2009 at 5:34 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
whizkidash is offline Offline
20 posts
since Nov 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Need SFTP script
Next Thread in Shell Scripting Forum Timeline: Shell script to append text file with today's date.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC