![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| saving values from awk expression into shell array | npatwardhan | Shell Programming and Scripting | 4 | 01-07-2009 08:58 PM |
| dynamic editing using shell script | habzone2007 | Shell Programming and Scripting | 1 | 05-14-2008 11:55 PM |
| editing a file via a shell script ?? | jimmyc | Shell Programming and Scripting | 2 | 03-28-2008 12:21 PM |
| Editing a file in a shell script | jowpup | UNIX for Dummies Questions & Answers | 3 | 02-08-2005 04:45 AM |
| Saving Perl scrpits in a UNIX Shell | hagrid | UNIX for Dummies Questions & Answers | 3 | 06-21-2001 01:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Editing & Saving using shell script
Hi, OS: Unix, linux, hp-unix (all unix flavours) Iam trying to change some string values, special characters or otherwise in a file. As of now, i go using vi <filename>, open the file and do the edit manually and save it. Is it possible to write a shell script so that i just run the script which inturn opens this particular file and changes all the stuff needed and save the same. The string values will be in any line in the file. In file change.sh (I have to change three things as mentioned below) ** change database **** From Code:
connect to F750PAX To Code:
connect to F750PBX *** Change of path *** From Code:
../jre/lpp/java/J1.4.2/bin/java com.telex.pt.environment.agent.Agent $1 To Code:
/usr/lpp/java/IBM/J1.4.2/bin/java com.telex.pt.environment.agent.Agent $1 ** Change of site name and port number **** From Code:
hubURL=http://clist.check.com:80/PSEMHUB/hub To Code:
hubURL=http://register.lagoon.com:8001/PSEMHUB/hub I suppose its possible, but iam looking for some lead from you folks. Also i would like to replicate this in windows environment by writing bat scripts (It does the same job as in unix - by changing values in saving file). In windows there is some testing tool which can be used. But iam only looking into through bat scripts and not using any tools. Anyway this forum is apart from windows. (Can anyone give me the windows bat script blog/forum link?). So i would appreciate if anyone case get me on the unix enivronment. thanks for your time. Last edited by Yogesh Sawant; 03-25-2009 at 02:31 AM.. Reason: added code tags |
|
||||
|
Oh. Thanks. Its as simple as that, which i dont know.
BTW, i understand you have used perl. I dont think i have perl installed in my box. How do i check if perl is installed? Iam yet to know 'perl'. Can i put this (your code) into my shell script and run the same? thanks once again for your response. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|