Sponsored Content
Top Forums UNIX for Advanced & Expert Users BASH Internal : Replace pattern with string without external command Post 302933799 by bakunin on Monday 2nd of February 2015 11:08:13 AM
Old 02-02-2015
Come on, Corona! Having telephatic abilities is part of the job description, no? ;-))

Being the better psychic i conclude you want to extract the IP-address of your variables content, i.e. the part between "(" and ")".

Carefully reread the part of the man page dealing with "${var%%...}" and "${var##...}" - the one cuts off from the beginning of the variable, the other from the end. You basically do your conversion in two steps, first everything up to "(" then everything behind ")".

I won't spoil the fun finding out how it works, therefore the exact implementation is left as an exercise to the reader.

I hope this helps.

bakunin
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Match pattern and replace with string

hi guys, insert into /*<new>*/abc_db.tbl_name this is should be replaced to insert into /*<new>*/${new}.tbl_name it should use '.' as delimiter and replace is there any way to do it using sed (6 Replies)
Discussion started by: sol_nov
6 Replies

2. Shell Programming and Scripting

using an awk internal variable as parameter for an external array

Hello, I am running a bash script under linux which first defines an CA-array like j=0 num1=120.00 num2=10.00 until do CA='echo $num1 + $j*$num2' j=$ done within the later awk section of this same script I want to read data from a file. If the value of the second column is... (3 Replies)
Discussion started by: MotAah
3 Replies

3. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

4. Shell Programming and Scripting

lftp script to connect to external sftp site and download to internal ftp and then send email

Hi there, I'm new to shell scripting and need some help if possible? I need to create a shell script (.sh) to run as a cron job on an ubuntu linux server to connect to an external sftp sites directory using credentials (which I have) and then download to our internal ftp server and then copy... (3 Replies)
Discussion started by: ghath
3 Replies

5. Shell Programming and Scripting

Replace a string pattern

Hi, I have a CSV with following type of data and would like to replace the timestamp information with 'null' string. Can you please suggest me on same? 8,1,'1','1',11,'2013-08-12 18:34:17.0','null',1,'2013-08-12 18:34:17.0','null','PROMOTIONAL','12','1','11','11',11,'0' Thanks for your... (10 Replies)
Discussion started by: bhupinder08
10 Replies

6. Red Hat

Disk in Linux machine are internal or external

How to check whether the disk in linux machine are internal or external ( from nas or san). How to identify internal(local) and external disks. Following are some details of my server. Thanks. #df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 15G 3.5G 10G... (2 Replies)
Discussion started by: salmanraza
2 Replies

7. Shell Programming and Scripting

Replace string in line below specific pattern?

Hi, I'm trying to replace a string with sed, in a text file containing this pattern: location alpha value x location beta value y location gamma value y location delta value y location theta value z ... What I want to achieve is: Find location beta into text file... (1 Reply)
Discussion started by: TECK
1 Replies

8. Shell Programming and Scripting

sed command to replace two character pattern with another pattern

Not able to paste my content. Please see the attachment :-( (2 Replies)
Discussion started by: vivek d r
2 Replies

9. Shell Programming and Scripting

Replace String matching wildcard pattern

Hi, I know how to replace a string with another in a file. But, i wish to replace the below string pattern EncryptedPassword="{gafgfa}]\asffafsf312a" i.e EncryptedPassword="<any random string>" To EncryptedPassword="" i.e remove the random password to a empty string. Can you... (3 Replies)
Discussion started by: mohtashims
3 Replies
wxHtmlWindow(3erl)					     Erlang Module Definition						wxHtmlWindow(3erl)

NAME
wxHtmlWindow - See external documentation: wxHtmlWindow. DESCRIPTION
See external documentation: wxHtmlWindow . This class is derived (and can use functions) from: wxScrolledWindow wxPanel wxWindow wxEvtHandler DATA TYPES
wxHtmlWindow() : An object reference, The representation is internal and can be changed without notice. It can't be used for comparsion stored on disc or distributed for use on other nodes. EXPORTS
new() -> wxHtmlWindow() See external documentation . new(Parent::wxWindow() (see module wxWindow)) -> wxHtmlWindow() Equivalent to new(Parent, []) . new(Parent::wxWindow() (see module wxWindow), Options::[Option]) -> wxHtmlWindow() Types Option = {id, integer()} | {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {style, integer()} See external documentation . appendToPage(This::wxHtmlWindow(), Source::string()) -> bool() See external documentation . getOpenedAnchor(This::wxHtmlWindow()) -> string() See external documentation . getOpenedPage(This::wxHtmlWindow()) -> string() See external documentation . getOpenedPageTitle(This::wxHtmlWindow()) -> string() See external documentation . getRelatedFrame(This::wxHtmlWindow()) -> wxFrame() (see module wxFrame) See external documentation . historyBack(This::wxHtmlWindow()) -> bool() See external documentation . historyCanBack(This::wxHtmlWindow()) -> bool() See external documentation . historyCanForward(This::wxHtmlWindow()) -> bool() See external documentation . historyClear(This::wxHtmlWindow()) -> ok See external documentation . historyForward(This::wxHtmlWindow()) -> bool() See external documentation . loadFile(This::wxHtmlWindow(), Filename::string()) -> bool() See external documentation . loadPage(This::wxHtmlWindow(), Location::string()) -> bool() See external documentation . selectAll(This::wxHtmlWindow()) -> ok See external documentation . selectionToText(This::wxHtmlWindow()) -> string() See external documentation . selectLine(This::wxHtmlWindow(), Pos::{X::integer(), Y::integer()}) -> ok See external documentation . selectWord(This::wxHtmlWindow(), Pos::{X::integer(), Y::integer()}) -> ok See external documentation . setBorders(This::wxHtmlWindow(), B::integer()) -> ok See external documentation . setFonts(This::wxHtmlWindow(), Normal_face::string(), Fixed_face::string()) -> ok Equivalent to setFonts(This, Normal_face, Fixed_face, []) . setFonts(This::wxHtmlWindow(), Normal_face::string(), Fixed_face::string(), Options::[Option]) -> ok Types Option = {sizes, integer()} See external documentation . setPage(This::wxHtmlWindow(), Source::string()) -> bool() See external documentation . setRelatedFrame(This::wxHtmlWindow(), Frame::wxFrame() (see module wxFrame), Format::string()) -> ok See external documentation . setRelatedStatusBar(This::wxHtmlWindow(), Bar::integer()) -> ok See external documentation . toText(This::wxHtmlWindow()) -> string() See external documentation . destroy(This::wxHtmlWindow()) -> ok Destroys this object, do not use object again AUTHORS
<> wxErlang 0.98.9 wxHtmlWindow(3erl)
All times are GMT -4. The time now is 04:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy