's:test1.com:New website is test1.com:g' will not give desired results, as you want to replace test.com with "New website is test1.com" whereas sed will be searcing for "test1.com" which doesn't exist
You are correct, it will not give desired results, and your sed suggestion is correct. However, in the code posted by digitalviking, test1.com will exist. The first expression will change www.test.com leaving www.test1.com which the second expression will find and (incorrectly) change.
After the first expression, the record would have been:
With the bold area containing what the second expression would match resulting in the final output for the record:
It is important to remember that each expression in a sed programme is applied to each record sequentially (modulo any branching/reading commands).
I am needing to replace a whole line of code in a file with a new line of code. This is what I need to do.
I need to replace.
$db_url = 'mysql://test_dev:test12@localhost/test';
With
$db_url = 'mysql://$dbuser:$dbpass@localhost/$dbase';
OK this is where it gets complicated. The... (4 Replies)
I have a problem in the following code ...
while read line
do
#Get Line Number
OLDLINE=`sed -n $Lineno $filename`
echo "Un Changed Line : "$OLDLINE
echo "Enter a New Pattern : "
read NewPattern <&1
echo "NewPattern :"$NewPattern
NEWLINE=`cat $filename | sed -n... (1 Reply)
hi,
when i am doing the following things getting error
Can anyone please suggest
i have a file where there is a line like the following
branch=dev sdf dev jin kilii fin kale boyle dev james dev
i want to search the existance of dev in the above line.
cat "$file" | sed -n... (8 Replies)
We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>"
FILE1.XML
1. <itemList>
2. <item type="Manufactured">
3. <resourceCode>431048</resourceCode>
4. ... (0 Replies)
Hi all,
assume that i am having the following line in a file called file1.
triumph and disaster must be treated same.
I want to replace this line with.
follow excellence success will chase you.
is it possible to do this using sed. if possible kindly post me the... (2 Replies)
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
Hi All,
As mentioned in the title I have two text files and I would like to replace line number 5 of file #1 with line number 4 of file #2
e.g.
file 1
wqwert
4.4464002
3
319
286
369
46.320002
56.150002
45.100002
1
1
1
0.723 (12 Replies)
Hi all,
I need to replace a line
export TZ=xxxxxxxx
with the line
export TZ=$1
Now, "xxxxxxxx" in the above line is some unknown string and $1 is a parameter. I want the content of $1 to be replaced with "xxxxxxxx".
Kindly help me how to do this in the shell scripting. (5 Replies)
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Hello is it possible with awk or sed to replace any white space with the previous line characters in the same position?
I am asking this because the file I have doesn't always follow a pattern.
For example the file I have is the result of a command to obtain windows ACLs:
icacls C:\ /t... (5 Replies)
Discussion started by: nakaedu
5 Replies
LEARN ABOUT CENTOS
xtvacreatepopupshell
XtCreatePopupShell(3) XT FUNCTIONS XtCreatePopupShell(3)NAME
XtCreatePopupShell, XtVaCreatePopupShell - create a popup shell
SYNTAX
Widget XtCreatePopupShell(String name, WidgetClass widget_class, Widget parent, ArgList args, Cardinal num_args);
Widget XtVaCreatePopupShell(String name, WidgetClass widget_class, Widget parent, ...);
ARGUMENTS
args Specifies the argument list to override the resource defaults.
name Specifies the text name for the created shell widget.
num_args Specifies the number of arguments in the argument list.
parent Specifies the parent widget.
widget_class
Specifies the widget class pointer for the created shell widget.
... Specifies the variable argument list to override the resource defaults.
DESCRIPTION
The XtCreatePopupShell function ensures that the specified class is a subclass of Shell and, rather than using insert_child to attach the
widget to the parent's children list, attaches the shell to the parent's pop-ups list directly.
A spring-loaded pop-up invoked from a translation table already must exist at the time that the translation is invoked, so the translation
manager can find the shell by name. Pop-ups invoked in other ways can be created ``on-the-fly'' when the pop-up actually is needed. This
delayed creation of the shell is particularly useful when you pop up an unspecified number of pop-ups. You can look to see if an appropri-
ate unused shell (that is, not currently popped up) exists and create a new shell if needed.
SEE ALSO XtCreateWidget(3), XtPopdown(3), XtPopup(3)
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
X Version 11 libXt 1.1.4 XtCreatePopupShell(3)