Sponsored Content
Top Forums Shell Programming and Scripting Replacing Port number Using Sed Post 302389110 by Scott on Friday 22nd of January 2010 04:56:56 PM
Old 01-22-2010
Hi.

Based on your original sed:

Code:
sed "s/http-port = 80 /http-port = $ans/g" demo

all I can see that is wrong is a space before the / in the substitution part of your sed expression:

i.e. should be
Code:
sed "s/http-port = 80/http-port = $ans/g" demo

Code:
$ cat Test
ans=81
sed "s/http-port = 80 /http-port = $ans/g" demo
$ ./Test
http-port = 80

$ cat Test
ans=81
sed "s/http-port = 80/http-port = $ans/g" demo
$ ./Test
http-port = 81

 

10 More Discussions You Might Find Interesting

1. Cybersecurity

get number of a port

Hello every one. I work in a LAN with many application server. Each one use a different port. What command permit to obtain the number of these port. thanks (2 Replies)
Discussion started by: hoang
2 Replies

2. UNIX for Dummies Questions & Answers

how to know whether particular port number is free or not

I wish to know whether a particular port is free or not in my SUN solaris SPARC machine . I wish to use that particular port for one server software. How do I know that. (2 Replies)
Discussion started by: Hitesh Shah
2 Replies

3. UNIX for Dummies Questions & Answers

Need to know port number

Hi expert, I wanted to know in which port my apache is running in solaris box thanks Shaan (1 Reply)
Discussion started by: shaan_dmp
1 Replies

4. UNIX for Dummies Questions & Answers

port number

hi all i want to connect a system, how can i know the port number of a system. (2 Replies)
Discussion started by: tukuna82
2 Replies

5. Shell Programming and Scripting

Need help in finding and replacing port numbers.

Hi All, I am trying to write a shell script which firstly will search some files and then increase the port numbers mentioned in them by a certain no. let me clear it with an example- suppose there r few files a,b,c,d.... file a's content- <serverEntries xmi:id="ServerEntry_1"... (3 Replies)
Discussion started by: ankushsingh10
3 Replies

6. Shell Programming and Scripting

Replacing the first 0 with a number

Hi, Appreciate any help in advance ;-) There are some numbers between 0 and 1, 0 not included: .2500, .3333, .5000, .6666, .7500, 1.000 How to replace the first 0 ( after the dot ) with a number, say, if the number is 3: .2500 will be .2530 .5000 will be .5300 .7500 will be .7530 ... (3 Replies)
Discussion started by: wanttolearn
3 Replies

7. IP Networking

Binding the port number.

Hi all, Application A is using an port number 100 and is binded to an interface 1. Application B is using an port number 100 and is binded to an interface 2. can we bind the two applications on same port number based on interfaces. what i want to know is two... (3 Replies)
Discussion started by: vijaypdp2006
3 Replies

8. Shell Programming and Scripting

sed inside sed for replacing string

My need is : Want to change docBase="/something/something/something" to docBase="/only/this/path/for/all/files" I have some (about 250 files)xml files. In FileOne it contains <Context path="/PPP" displayName="PPP" docBase="/home/me/documents" reloadable="true" crossContext="true">... (1 Reply)
Discussion started by: linuxadmin
1 Replies

9. UNIX for Advanced & Expert Users

Port number file

In which file inside the application code we can find the list of port numbers that the application is entitled to listen? (4 Replies)
Discussion started by: p_gautham12
4 Replies

10. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
Bio::SearchIO::cross_match(3pm) 			User Contributed Perl Documentation			   Bio::SearchIO::cross_match(3pm)

NAME
Bio::SearchIO::cross_match - CrossMatch-specific subclass of Bio::SearchIO SYNOPSIS
# Working with iterations (CrossMatch results) my $searchIO = Bio::SearchIO->new( -format => 'cross_match', -file => "$file.screen.out" ) while(my $r = $searchIO->next_result) { while(my $hit = $r->next_hit) { while(my $hsp = $hit->next_hsp) { #Do the processing here. } } } # See Bio::SearchIO for information about working with Results. # See Bio::SearchIO # for details about working with Bio::SearchIO. DESCRIPTION
This object is a subclass of Bio::SearchIO and provides some operations that facilitate working with CrossMatch and CrossMatch results. For general information about working with Results, see Bio::Search::Result::GenericResult. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Shin Leong Email sleong@watson.wustl.edu CONTRIBUTORS
Additional contributors names and emails here APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ next_result Title : next_result Usage : $result = stream->next_result Function: Reads the next ResultI object from the stream and returns it. Certain driver modules may encounter entries in the stream that are either misformatted or that use syntax not yet understood by the driver. If such an incident is recoverable, e.g., by dismissing a feature of a feature table or some other non-mandatory part of an entry, the driver will issue a warning. In the case of a non-recoverable situation an exception will be thrown. Do not assume that you can resume parsing the same stream after catching the exception. Note that you can always turn recoverable errors into exceptions by calling $stream->verbose(2) (see Bio::Root::RootI POD page). Returns : A Bio::Search::Result::ResultI object Args : n/a See Bio::Root::RootI _alignment Title : _alignment Usage : private _parse Title : _parse Usage : private result_count Title : result_count Usage : $num = $stream->result_count; Function: Gets the number of CrossMatch results that have been parsed. Returns : integer Args : none Throws : none perl v5.14.2 2012-03-02 Bio::SearchIO::cross_match(3pm)
All times are GMT -4. The time now is 12:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy