Sponsored Content
Top Forums UNIX for Advanced & Expert Users BASH Internal : Replace pattern with string without external command Post 302933794 by popeye on Monday 2nd of February 2015 10:50:44 AM
Old 02-02-2015
Hammer & Screwdriver BASH Internal : Replace pattern with string without external command

Morning,
I'm trying step up my scripting game .. SmilieSmilieSmilie

Is there a way to do the replacement with an or without using an external command ?

I did try but no joy.

Code:
var=${var//\(|\)/}



Code:
#!/bin/bash
var="lulus.UbiRwidgets.com (10.1.1.1)"
var=${var//\(/}
var=${var//\)/}
echo "$var"

Thanks !!
Have a great day !!
Pop
 

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
wxUpdateUIEvent(3erl)					     Erlang Module Definition					     wxUpdateUIEvent(3erl)

NAME
wxUpdateUIEvent - See external documentation: wxUpdateUIEvent. DESCRIPTION
See external documentation: wxUpdateUIEvent . Use wxEvtHandler:connect/3 with EventType: : update_ui See also the message variant #wxUpdateUI{ } event record type. This class is derived (and can use functions) from: wxCommandEvent wxEvent DATA TYPES
wxUpdateUIEvent() : 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
canUpdate(Win::wxWindow() (see module wxWindow)) -> bool() See external documentation . check(This::wxUpdateUIEvent(), Check::bool()) -> ok See external documentation . enable(This::wxUpdateUIEvent(), Enable::bool()) -> ok See external documentation . show(This::wxUpdateUIEvent(), Show::bool()) -> ok See external documentation . getChecked(This::wxUpdateUIEvent()) -> bool() See external documentation . getEnabled(This::wxUpdateUIEvent()) -> bool() See external documentation . getShown(This::wxUpdateUIEvent()) -> bool() See external documentation . getSetChecked(This::wxUpdateUIEvent()) -> bool() See external documentation . getSetEnabled(This::wxUpdateUIEvent()) -> bool() See external documentation . getSetShown(This::wxUpdateUIEvent()) -> bool() See external documentation . getSetText(This::wxUpdateUIEvent()) -> bool() See external documentation . getText(This::wxUpdateUIEvent()) -> string() See external documentation . getMode() -> WxUpdateUIMode Types WxUpdateUIMode = integer() See external documentation . WxUpdateUIMode is one of ?wxUPDATE_UI_PROCESS_ALL | ?wxUPDATE_UI_PROCESS_SPECIFIED getUpdateInterval() -> integer() See external documentation . resetUpdateTime() -> ok See external documentation . setMode(Mode::WxUpdateUIMode) -> ok Types WxUpdateUIMode = integer() See external documentation . WxUpdateUIMode is one of ?wxUPDATE_UI_PROCESS_ALL | ?wxUPDATE_UI_PROCESS_SPECIFIED setText(This::wxUpdateUIEvent(), Text::string()) -> ok See external documentation . setUpdateInterval(UpdateInterval::integer()) -> ok See external documentation . AUTHORS
<> wxErlang 0.98.9 wxUpdateUIEvent(3erl)
All times are GMT -4. The time now is 05:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy