The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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
can someone help me with modifying this file eamani_sun Shell Programming and Scripting 2 05-22-2008 01:15 PM
Modifying a csv file from Shell Script not4google Shell Programming and Scripting 2 11-21-2006 06:47 AM
Modifying the final output file charbel Shell Programming and Scripting 5 10-10-2006 01:36 PM
UNIX Start-up file location daveo61 UNIX for Dummies Questions & Answers 3 07-22-2002 08:35 AM
Modifying IP Address/Gateway/Subnet in SCO Unix PBNOSGT UNIX for Dummies Questions & Answers 12 01-07-2002 12:31 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-24-2006
pjanakir pjanakir is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 16
Modifying the URL to point to another location in a .sh UNIX file

Hello,
I wanted to know how I could change my UNIX script to point to a URL location different from what I had specified earlier. For instance, in my shell script, I want to change the parameter for SMGR.
Currently,
SMGR = http://192.168.32.160:8084/Simmanr6 should be changed to
SMGR = http://192.168.32.120:8081/SimPortal

How should I do this? Do I just edit the contents of the file and change it manually or is there a script that needs to be written?

Please let me know ASAP.

Thx.
  #2 (permalink)  
Old 01-25-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
How many files do you have to modify? If this is just 1-2 files and a one time activity, just open the file, modify and save.

Scripting is to automate repeated jobs or carry out one off large volume jobs.
  #3 (permalink)  
Old 01-25-2006
pjanakir pjanakir is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 16
Changing URL!

Hi,
It's only a single file and I have to change the location of SMGR to point to a different URL location, that's all. Is there a specific command or a script required to change the URL? Let me know ASAP.

Thx.
  #4 (permalink)  
Old 01-25-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
you simply have to edit the file. to edit the file you can use vi editor. but if you are not aware of it, you may have to learn a bit of it. and if you dont want to go thru that hastle just use the command

sed 's#SMGR = http://192.168.32.160:8084/Simmanr6#http://192.168.32.120:8081/SimPortal/g' yourfilename > tmpfilename
mv tmpfilename yourfilename

i would suggest you to learn a bit of vi and then edit the file.
  #5 (permalink)  
Old 01-25-2006
pjanakir pjanakir is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 16
URL Modification!

This method that you suggested should be done from the UNIX command prompt, correct? I did try to edit in the vi editor, but the test failed to launch for our application. Let me know if you have further suggestions.
  #6 (permalink)  
Old 01-25-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
yes, the two commands were for unix command prompt

when you use vi editor, what failed to launch ? I dont get it.
what are the errors.

after editing in vi editor, did you save the file, can you run the command
grep '^SMGR =' filename
and let me know what you see?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:04 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0