Modifying the URL to point to another location in a .sh UNIX file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Modifying the URL to point to another location in a .sh UNIX file
# 1  
Old 01-24-2006
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  
Old 01-25-2006
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  
Old 01-25-2006
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  
Old 01-25-2006
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  
Old 01-25-2006
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  
Old 01-25-2006
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?
# 7  
Old 01-25-2006
URL Modification!

Hi,
The errors are internal to our application. Has nothing to do with UNIX. My team has told me not to modify that script, only a particular directory path. I will try using the sed approach though and maybe that will work.

Thx. for your help.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File transfer from UNIX to shared location using shell script

Is there any possible way transfering the file from unix to shared location using shell script. i had created the batch script to fetch the files from unix to shared location and it works fine. Due to some problem in windows unable to transfer the file to shared location automatically. can anyone... (2 Replies)
Discussion started by: venkat918
2 Replies

2. Shell Programming and Scripting

Copy file from UNIX to shared location

Hi All, I want to transfer file from UNIX to shared locataion . Shared location doesn't resides on my system. Can somebody tell me is there any way i can transfer file from UNIX to shared location without using any tool WINSCP. Thanks, Amit (1 Reply)
Discussion started by: Amit786
1 Replies

3. Shell Programming and Scripting

Reading URL using Mechanize and dump all the contents of the URL to a file

Hello, Am very new to perl , please help me here !! I need help in reading a URL from command line using PERL:: Mechanize and needs all the contents from the URL to get into a file. below is the script which i have written so far , #!/usr/bin/perl use LWP::UserAgent; use... (2 Replies)
Discussion started by: scott_cog
2 Replies

4. Shell Programming and Scripting

How to find a existing file location and directory location in Solaris box?

Hi This is my third past and very impressed with previous post replies Hoping the same for below query How to find a existing file location and directory location in solaris box (1 Reply)
Discussion started by: buzzme
1 Replies

5. Shell Programming and Scripting

File created in a different location instead of desired location on using crontab

Hi, I am logging to a linux server through a user "user1" in /home directory. There is a script in a directory in 'root' for which all permissions are available including the directory. This script when executed creates a file in the directory. When the script is added to crontab, on... (1 Reply)
Discussion started by: archana.n
1 Replies

6. Shell Programming and Scripting

How to fetch File from a URL to Unix Server?

Hello All, I wanted to get the software to be fetched from the Service Provide URL to my unix server. I tired using the mget, but resulted in error. Please take a look. $ wget -O V3-0-5-2.Solaris8-SPARC.tar.gz --http-user=hd87es3 --http-passwd=987dnja7 http://beyond.abinitio.com... (3 Replies)
Discussion started by: raghunsi
3 Replies

7. UNIX for Dummies Questions & Answers

open windows's .url file in unix

In windows, I can create a shortcut for websites. It's a .url file. the content of the file is like: How can I open it, the .url file, in firefox or google chrome in Unix(or just ubuntu)? (2 Replies)
Discussion started by: hz_i3
2 Replies

8. Shell Programming and Scripting

Put one string from one location to another location in a file

Hi Everyone, I have 1.txt here a b c' funny"yes"; d e The finally output is: here a b c d e' funny"yes"; (1 Reply)
Discussion started by: jimmy_y
1 Replies

9. UNIX for Advanced & Expert Users

Posting a file from Unix to URl

HI Can you please help me,how to post a xml file from Unix to URL. Basically,i want to map contents of my file at an url Regards Pooja (1 Reply)
Discussion started by: PoojaM
1 Replies

10. UNIX for Dummies Questions & Answers

UNIX Start-up file location

I would like to know where to find the start-up sequence for UNIX. I would like to find the command that starts the database up and do not know where to look and I'm sure there is a file that contains this info. Where is it??? Thanks in advance. Dave. (3 Replies)
Discussion started by: daveo61
3 Replies
Login or Register to Ask a Question