Sponsored Content
Top Forums Shell Programming and Scripting sed - replacing on the right of a pattern and looking for exact word? Post 302450404 by bartus11 on Thursday 2nd of September 2010 01:16:30 PM
Old 09-02-2010
^ means start of the line, matching regardles of the characters' case is done by /i modifier.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing a word after a matched pattern

Hello, Actually i want to replace the word after a matched pattern. For Ex: lets say that i am reading a file line by line while read line do echo $line # i need to search whether a pattern exists in the file and replace the word after if the pattern exist. # for example :... (1 Reply)
Discussion started by: maxmave
1 Replies

2. Shell Programming and Scripting

SED: delete and print the only exact matched pattern

I am really need help with the regular expression in SED. From input file, I need to extract lines that have the port number (sport or dport) as defined. The input file is something like this time=1209515280-1209515340 dst=192.168.133.202 src=208.70.8.23 bytes=2472 proto=6 sport=80 dport=1447... (6 Replies)
Discussion started by: new_buddy
6 Replies

3. Shell Programming and Scripting

Sed and replacing one occurence of pattern

I would like to use sed to replace one occurence of a pattern in a file. When I use the s/// command it replaces all occurences of the pattern in the file. Should I be using something other than sed? Thanks (6 Replies)
Discussion started by: ss9u
6 Replies

4. Shell Programming and Scripting

Need help in sed command ( Replacing a pattern inside a file with a variable value )

Hello, The following sed command is giving error sed: -e expression #1, char 13: unknown option to `s' The sed command is echo "//-----" | sed "s/\/\/---*/$parChk/g" where parChk="//---ee-" How can i print the variable value from sed command ? And is it possible to replace a... (2 Replies)
Discussion started by: frozensmilz
2 Replies

5. Shell Programming and Scripting

Replacing part of a pattern in sed

Hi I have a piece of xml that has a pattern like this <int>159</int><int>30</int> I want to find this pattern but only substitute the second part of the pattern to {rid1}. Is that possible in sed ? Thanks. ---------- Post updated at 12:10 PM ---------- Previous update was at 12:01 PM... (11 Replies)
Discussion started by: vnn
11 Replies

6. Shell Programming and Scripting

sed to exact matching a word in free BSD

Hi, Thanks for looking at this issue. I have many words/lines in a files like below apple pine apple custored apple apple apple if i want to replace only/exact apple occurrences with XXX i could use below, sed 's/\<apple\>/XXX/g' filename this is working in Linux, but now in my free BSD... (3 Replies)
Discussion started by: ramanaraoeee
3 Replies

7. UNIX for Dummies Questions & Answers

Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word

I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL. I need the whole word... (6 Replies)
Discussion started by: chicchan
6 Replies

8. Shell Programming and Scripting

Replacing a particular word with another word in all the xml's under a particular directory with sed

Hi Folks, Could you please advise what will be the SED command to replace a word in all xml's under a particular directory for example let say I rite now at the following below location $ cd /ter/rap/config now under config directory there will be lots of xml file , now my objective is to... (1 Reply)
Discussion started by: punpun66
1 Replies

9. Shell Programming and Scripting

sed - Exact pattern matching and replace

Hi Team, I am facing a problem as under, Suppose I have a file (test.txt) with the below content (all braces and slashes are included in the contents of the file) Now I want to append few words below matched line, I have written the below sed: sed '/option/a insert text here' test... (2 Replies)
Discussion started by: ankur328
2 Replies

10. UNIX for Beginners Questions & Answers

Getting error in sed command in replacing a word in all xmls

Hi Folks , I have to replace the following value in all the xml files so the value is tcp://pondevpms1.fm.rbsgrp.net:6033,pondevpms2.fm.rbsgrp.net:6033 and the value with it need to be replaces is shown below tcp://pondevpms1:3063 so i have fired the below command inside... (3 Replies)
Discussion started by: unclesamm
3 Replies
XkbVirtualModsToReal(3) 					   XKB FUNCTIONS					   XkbVirtualModsToReal(3)

NAME
XkbVirtualModsToReal - Determines the mapping of virtual modifiers to core X protocol modifiers SYNOPSIS
Bool XkbVirtualModsToReal (XkbDescPtr xkb, unsigned int virtual_mask, unsigned int *mask_rtrn); ARGUMENTS
- xkb keyboard description for input device - virtual_mask virtual modifier mask to translate - mask_rtrn backfilled with real modifiers DESCRIPTION
Xkb maintains a virtual modifier mapping, which lists the virtual modifiers associated with, or bound to, each key. The real modifiers bound to a virtual modifier always include all of the modifiers bound to any of the keys that specify that virtual modifier in their vir- tual modifier mapping. The server.vmodmap array indicates which virtual modifiers are bound to each key; each entry is a bitmask for the virtual modifier bits. The server.vmodmap array is indexed by keycode. The vmodmap and vmods members of the server map are the "master" virtual modifier definitions. Xkb automatically propagates any changes to these fields to all other fields that use virtual modifier mappings. For example, if Mod3 is bound to the Num_Lock key by the core protocol modifier mapping, and the NumLock virtual modifier is bound to they Num_Lock key by the virtual modifier mapping, Mod3 is added to the set of modifiers associated with NumLock. The virtual modifier mapping is normally updated whenever actions are automatically applied to symbols and few applications should need to change the virtual modifier mapping explicitly. Use XkbGetMap to get the virtual modifiers from the server or use XkbGetVirtualMods to update a local copy of the virtual modifiers bind- ings from the server. To set the binding of a virtual modifier to a real modifier, use XkbGetVirtualMods If the keyboard description defined by xkb includes bindings for virtual modifiers, XkbVirtualModsToReal uses those bindings to determine the set of real modifiers that correspond to the set of virtual modifiers specified in virtual_mask. The virtual_mask parameter is a mask specifying the virtual modifiers to translate; the i-th bit (0 relative) of the mask represents the i-th virtual modifier. If mask_rtrn is non-NULL, XkbVirtualModsToReal backfills it with the resulting real modifier mask. If the keyboard description in xkb does not include vir- tual modifier bindings, XkbVirtualModsToReal returns False; otherwise, it returns True. RETURN VALUES
True The XkbVirtualModsToReal function returns True if the keyboard description in xkb does include virtual modifier bindings. False The XkbVirtualModsToReal function returns False if the keyboard description in xkb does not include virtual modifier bind- ings. SEE ALSO
XkbGetMap(3), XkbGetVirtualMods(3) NOTES
It is possible for a local (client-side) keyboard description (the xkb parameter) to not contain any virtual modifier information (simply because the client has not requested it) while the server's corresponding definition may contain virtual modifier information. X Version 11 libX11 1.5.0 XkbVirtualModsToReal(3)
All times are GMT -4. The time now is 03:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy