General :: Replace Multiple Instances From X To Y In Line

Feb 1, 2010

I have a line of text with multiple web links in the line. I'd like to replace the actual links with the text "<web-link>" so I don't accidentally hit them while reading on my iphone. I've tried many versions of the following sed command, sed 's/(http.*)/<web_link>/g', but it simply replaces everything between the first instance of "(http" and the last instance of ")" with <web_link>, or does nothing at all.

Ex: This line has a link to a web page (http://www.webpage.com/file.html) then some more text (extra text) and then another link (http://www.nextwebpage.com.index.html) to a website.
$ echo "This line has a link to a web page (http://www.webpage.com/file.html) then some more text (extra text) and then another link (http://www.nextwebpage.com.index.html) to a website." | sed 's/(http.*)/<web_link>/g'

What I get is: This line has a link to a web page <web_link> to a website.
What I'd like is: This line has a link to a web page <web_link> then some more text (extra text) and then another link <web_link> to a website.
What am I doing wrong with my sed command?

View 4 Replies


ADVERTISEMENT

Programming :: Find And Replace Multiple Instances?

Aug 13, 2010

I have a file with the following in it:

:0 local /usr/X11R6/bin/X -nobanner
:1 local /usr/X11R6/bin/X

I need to add "-nolisten tcp" to both of these lines and cannot figure out how to do it. I can get it to do the first one, but not the 2nd and so on. How do I search the file and loop though it to change them all?

View 14 Replies View Related

General :: Search And Replace Line In Multiple Files?

Jul 13, 2010

Hello, I need some help searching through multiple files, finding a line and replacing that line. The line I am searching for is:

password key ******* 1222554

ultimately I want to be able to delete the numbers after the asterisks . my thoughts are to create a script that will search for the line password key ******* and delete it then replace it with password key ******* my files are located in /opt and they are all txt files.

View 13 Replies View Related

Programming :: Awk Multiple Line Search And Replace?

May 1, 2011

I am trying to search and replace a multi line pattern in a php file using awk.The pattern starts with

<div id="navbar">
and ends with
</div>

[code]...

View 3 Replies View Related

Ubuntu :: Command Line - Find And Replace Text Within Multiple Files?

Aug 28, 2010

I'm pretty sure this is doable from the command line, but my CLI skills have degraded a lot since my pre-Y2K admin days. The goal is to search all the files in the directory for a very long string of text and replace it with another string of text. The text being searched for is my Google Adsense code (which will be stripped from my website) and it will be replaced with a placeholder so I can easily tack something else in there in the future.

Seeing how I have that long snip of code on about 100 pages, automating the process would make life easier.
If I was searching for a single word, I can see ways to do this.
If I paste the code I'm searching for into a text file, is there a way to:
find (contents of oldstring.txt) and replace with (contents of newstring.txt)?

View 9 Replies View Related

General :: Run Multiple Instances Of Same Program?

Feb 23, 2011

In windows xp, i created another user account. Now i can run a second instance of any program by right clicking on it and selecting Run as. Is such a thing possible in linux (centos or ubuntu) in graphical environment ?

View 4 Replies View Related

General :: Start Multiple Instances Of Firefox?

Mar 31, 2010

How can I have multiple independent instances of Mozilla Firefox 3.5 on the same X server, but started from different user accounts (consequently, different profiles)?

Limited success was only with Xephyr :1, DISPLAY=:1 /usr/local/bin/firefox, but Xephyr has no Cygwin/X's "rootless" mode so it's not comfortable (see other question).

The idea is to have one Firefox instance for various "Serious Business" things and the other for regular browsing with dozens of add-ons securely isolated.

View 2 Replies View Related

General :: Why No Multiple Instances Of Firefox As On Windows

May 4, 2010

On Windows If I run Firefox as user jack, and then try to start another instance of firefox I will be unable to, as one is already running.If I choose to run firefox as administrator,then I can have two instances of firefox, separate from each other side by side, because they are under different user accounts.This does not seem to be true on Linux.As user jack if I start firefox, like on windows I am unable to start a new instance.If I open a terminal and change to root, set XAUTHORITY to jacks .Xauthority and try to start firefox as root....I get the error that firefox is already running.

View 1 Replies View Related

General :: Run Multiple Squid Instances On Server?

Sep 20, 2010

I need to run multiple squid instances on my server , I am running squid version squid-2.7.STABLE5-1.el4 on RHEL 4.7 , kindly tell me how to do so. by the way , I need to run two instance because i need to configure my proxy to act as a reverse proxy and a forward proxy, and people told me that you cannot run a forward and reverse proxy on the same instance.

View 4 Replies View Related

General :: Multiple Instances Of Apache On One Physical Server - Configuration

Apr 2, 2011

I have to run multiple instances of apache on the same physical machine, as we have different OAM policies for different domains.is in the httpd.conf file can I have ServerName same in two instances of apache, like

ServerName: prod_machine (actual machine name)

In the vhconf files I do have different servernames for virtual hosts. Apache instances are running on same IP but different ports. I am including various vhost files in the main httpd.conf file. Can I skip servername in the main httpd.conf file and include different servernames in the virutal hosts configs. OS: Solaris10

View 1 Replies View Related

General :: Firefox Terminates If Multiple Instances Of Flash Player Running?

Feb 17, 2010

If i have, say, ..... tab opened and if a click on some of the related videos (while it's still playing) firefox terminates. The same if I open ..... on one tab and myspace on another - firefox just shuts down.

I want to know why this happens, is it a bug and how can i fix it ?

View 2 Replies View Related

General :: Replace Line With Another Line In Shell Script?

Feb 26, 2010

I have the file abc.txt

cat abc.txt This is a test file Nothing is new in this world

I want to replace "This is a test file" to "Text is replaced"

Code:
FindString='This is a test file'
ReplaceString='Text is replaced'
Findarray=(`echo $FindString | tr ' ' ' '`)

[Code]....

But this is not effective. how to replace entire line either using sed or awk or any other utility.

View 5 Replies View Related

Fedora :: Run Multiple Instances Of Yum At The Same Time?

Jun 24, 2010

Is there any way to run multiple instances of yum at the same time. The need is to speed up the install process.

View 2 Replies View Related

Ubuntu :: Run Multiple Instances Of Ushare ?

Nov 22, 2010

I have multiple hard drives with videos on them and i can only get the my xbox to read the 1st in my list of directories. So i wanted to know can i run multiple instances of ushare and use one for each hard drive? Is it possible?

View 3 Replies View Related

Ubuntu :: Multiple Instances Of Terminal App?

Jun 25, 2011

How can I make it so that I can open multiple new instances of the terminal app by clicking on the corresponding icon? I'm running 11.04 with Gnome 3.

View 5 Replies View Related

Ubuntu :: Cannot Run Multiple Instances Of A Program

Jun 29, 2011

If I have a program running in one workspace and then switch to another workspace and open the same program it switches back to the first workspace.

View 5 Replies View Related

Programming :: Run Multiple Instances Of A Jar Executable?

May 5, 2009

It is possible to run multiple instances of a jar executable. Is it possible that only a single instance of the jar runs? Wrappers like JSmooth or Launch4J can be made to run as a single instance. But since there are no such wrappers for linux, I need a way to restrict the jar to a single instance. How to embed the jar file into an executable such it runs a single instance?

View 14 Replies View Related

General :: Replace Multiple Spaces By One Tab

Feb 2, 2011

Ive some textfiles which contains some colums seperated by a various number of spaces, but instead i need one single tab as a seperator.

View 5 Replies View Related

Debian :: Multiple Instances Of Mumble-server?

Oct 31, 2015

i'm new to linux, and i want to create mumble servers for my friends.My first server is finished and he works but, is it possible to create multiples instances of mumble ?

View 1 Replies View Related

Fedora Servers :: Multiple Instances Of Pulesaudio?

Sep 9, 2010

I've got two sound cards fitted, before I've always killed pulseaudio as a pain in the butt.

Without pulseaudio enabled I could run two audio apps simultaneously, ie run a SDR ( software defined radio) app , and listen to music or watch TV at the same time.

However, with puls audio running, you can only run one, either input to either output. So can a second instance of pulseaudio be run, master and slave perhaps ?

View 6 Replies View Related

Ubuntu :: Disable Multiple Instances Of Evolution?

Feb 27, 2010

The great clock applet shows tasks and appointments from the evolution calendar. That's a great and fast overview of my agenda. But clicking a task of appointment opens a new instance from evolution every time, which is enormously annoying and really destroying productivity. I don't want 15 calendars open, I want the applet to behave like an index. So it should reuse the open instance and bring focus to the clicked appointment or task. How do I disable multiple instances of evolution?

View 2 Replies View Related

Ubuntu Servers :: Multiple Instances Of A Daemon?

May 27, 2010

I have a test server on which I'd like to run up to 30 separate instances of a program as daemons, each running on a different IP address bound to the server. I've created a init script that takes an additional command line parameter - the last octet of the IP address. For example:

Code:

sudo myprog 40 start
sudo myprog 41 start

This would run instances of the program on IP addresses 192.168.1.40 and 192.168.1.41 respectively. But it's looking like this approach isn't doable if I wish to have any or all of these run at startup, as the links in the rcN.d directories can only link to the init script, not pass a parameter.

View 2 Replies View Related

Ubuntu :: CPU 100% On Boot / Multiple Instances Of Same Process

Jul 30, 2010

I tried the google and browsing the known bugs in the sticky before posting this thread.On boot the machine is pegged at 100%. It is a dual-core with 4GB of ram and is running 10.04, 64bit. Also, as time goes on it eats up all the ram till theres maybe 32mb free. What happens is there are multiple 4-10+ identical processes running. seem to be gnome related.The machine sits idle on my floor and runs samba and apache/mysql/gallery for my test website that no on but myself visits.

View 5 Replies View Related

Ubuntu :: Enable Multiple Instances Of An Application

Oct 14, 2010

I have enabled netbook-launcher-efl and like the interface quite a lot, but it only allows me to launch a single instance of each application. I was told in an unrelated thread that there should be a setting in gconf-editor that enables multiple instances to be launched, but I thought it would be more appropriate if I broke that out into a separate thread.

View 3 Replies View Related

Ubuntu :: Multiple Instances Of Apps In Unity?

May 2, 2011

Using more than one instance of the same app is a real pita in Unity.If I have 3 (or more) pdf documents open in evince then there isn't a way to shift from one to the other using the mouse. Previously I had the windows on the taskbar and could click on the one I wanted. In Unity clicking on the evince icon on the launcher just brings ALL the instances of evince to the top - I still then have to shuffle the windows around to get the one I want.I've been trying to get used to Unity over the last few days, so maybe I am just doing it wrong, but if not then maybe I should file a bug report?

View 8 Replies View Related

Programming :: $1 Variable In Multiple Instances Of Same Script?

May 27, 2010

I am running a script that can run as many as 10 simultaneous times. During my testing, i noticed that if the script starts while another is in process, it inherits the $1 variable, which is always different.For example, the script starts with "scripthere.sh entry1", anther one starts almsot at the same time "scripthere.sh entry2". As the script is running, the second instance inherits $1 from the first script. So instead of $1 entry2, it shows up as entry1. how I can store $1 so that its unique to that instance of the script only?

View 2 Replies View Related

Software :: Bash Jobs Over Multiple Instances?

May 20, 2010

I know that bash can suspend and resume processes, but I am interested in forking and resuming them from different bash instances. So, for example, forking a gui app started from the console so that it will not crash when the terminal is closed. I currently know about screen, which can work, but I was wondering if there was a way similar to Ctrl+Z, bg and fg.

View 2 Replies View Related

Software :: Running Multiple Instances Of Audacious?

Dec 7, 2010

I need to run two instances (i.e run the program twice, with two separate windows) of Audacious. This is for a play where I need to have music and sound effects going at the same time. I could do this while running Fedora 13, but after upgrading to 14 the audacious package was updated and now can't do this. My attempts at downgrading have been unsuccessful, and I need the audio done by tonight (the last rehearsal). So... am I up the river without a boat, or is there a fast solution? I'm open to anything, as long as the music player has advanced controls (play, pause, stop, fast forward, rewind, forwards track, backwards track) and can have two instances running at the same time.

View 1 Replies View Related

General :: Replace One Line For Another In File?

Dec 1, 2010

I trying to change a file with hundreds of entries, replacing line with "IP Address Number" for "Host Name", one for another.

this is the original: [IP Address Configuration : "172_17_27_161.SUBNET_U"] IP Address Number = 172.17.27.161Assignment Type = 8Host Name = CAST124Last Used = 1290499294000MAC Address = 1 00 16 35 74 4C 59Client Identifier = 01 00 16 35 74 4C 59and the result desired is: [IP Address Configuration : "172_17_27_161.SUBNET_U"]Host Name = CAST124Assignment Type = 8IP Address Number = 172.17.27.161Last Used = 1290499294000MAC Address = 1 00 16 35 74 4C 59Client Identifier = 01 00 16 35 74 4C 59I know how to change one character by another with sed, but not to change a line for another, because I don't know in which line number it is.

View 3 Replies View Related

General :: Vim Replace All The Same Words In A Certain Line?

Dec 2, 2010

15 for(i = 0; i < N; i++) I want to replace "i" with "test" in the line above,whose line number is 15. When I tried this command :15s/i/test/ Line 15 turned to be this: for(test = 0; i < N; i++) It only replace the first "i",but I want to change all "i" in line 15.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved