Sponsored Content
Full Discussion: Grepping for Exact Strings
Top Forums Shell Programming and Scripting Grepping for Exact Strings Post 302313039 by devtakh on Monday 4th of May 2009 12:39:14 PM
Old 05-04-2009
Its a part of GNU awk's extended regular expression...check out yourself
Code:
\<away will match away but not stowaway
stow\> will match stow but not  stowaway

Looks like the requirement changed eventually...if this is not what was intended
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Grepping for strings

Hello. I have a dir of 1500+ dir. In these dirs is a file host, with a tag <x_tag>. I need to : 1. grep for all dir that contain this host file that contain <x_tag> 2. print a list of these host files containing <x_tag> is this better to egrep this? (5 Replies)
Discussion started by: t4st33@mac.com
5 Replies

2. Shell Programming and Scripting

Trouble grepping for multiple strings

I am having a heck of a time trying to write a script that will grep for multiple strings in a single file. I am really at my wits end here and I am hoping to get some feedback here. Basic information: OS: Solaris 9 Shell: KSH Oracle Database server I was trying to grep through a file... (5 Replies)
Discussion started by: thecoffeeguy
5 Replies

3. Shell Programming and Scripting

Grepping for two strings that MUST exist on the same line

Trying to find a way to grep for two names on a line. Both names must appear on the same line so '|' / OR is out. So far, I'm just messing around and I've got find . -name "*" | xargs grep "Smith" Let me explain. I'm at a top level and need to know all the names of the files that... (6 Replies)
Discussion started by: Rally_Point
6 Replies

4. Shell Programming and Scripting

Grepping Multiple Strings on the Same Line 'Or'

I've got this command that I've been using to find strings on the same line, say I'm doing a search for name: find . -name "*" | xargs grep -i "Doe" | grep -i "John" > output.txt This gives me every line in a file that has John and Doe in it. I'm looking to add a OR operator for the second... (5 Replies)
Discussion started by: Rally_Point
5 Replies

5. Shell Programming and Scripting

How to extract exact strings in shell scripting

/Path/snowbird9/nrfCompMgrRave1230100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird6/nrfCompMgrRave1220100920.log.gz:09/20/2010 06:14:51 ERROR Error Message. /Path/snowbird14/nrfCompMgrRave920100920.log.gz:09/20/2010 06:14:51 ERROR Error Message.... (0 Replies)
Discussion started by: Shirisha
0 Replies

6. Shell Programming and Scripting

QUESTION1: grep only exact string. QUESTION2: find and replace only exact value with sed

QUESTION1: How do you grep only an exact string. I am using Solaris10 and do not have any GNU products installed. Contents of car.txt CAR1_KEY0 CAR1_KEY1 CAR2_KEY0 CAR2_KEY1 CAR1_KEY10 CURRENT COMMAND LINE: WHERE VARIABLE CAR_NUMBER=1 AND KEY_NUMBER=1 grep... (1 Reply)
Discussion started by: thibodc
1 Replies

7. Shell Programming and Scripting

echo exact xml tag from an exact file

Im stumped on this one. Id like to echo into a .txt file all names for an xml feed in a huge folder. Can that be done?? Id need to echo <name>This name</name> in client.xml files. $path="/mnt/windows/path" echo 'recording names' cd "$path" for names in $path than Im stuck on... (2 Replies)
Discussion started by: graphicsman
2 Replies

8. Shell Programming and Scripting

Grepping multiple strings from one column

I have 3-column tab separated data that looks like the following: act of+n-a-large+vn-tell-v 0.067427 act_com of+n+n-a-large-manufacturer-n 0.129922 act-act_com-com in+n-j+vn-pass-aux-restate-v 0.364499666667 com nmod+n-j+ns-invader-n 0.527521 act_com-com obj+n-a-j+vd-contribute-v 0.091413... (2 Replies)
Discussion started by: owwow14
2 Replies

9. Shell Programming and Scripting

Grepping exact pattern and deleting the rows

Hi All, I have the Input as below: 21011513 6030 5570 1710 0 0 5140 0 3430 3430 0 21049513 152340 138260 101210 0 0 134440 0 33880 33880 0 31003514 16100 13280 7580 3250 1530 15650 8090 8100 ... (22 Replies)
Discussion started by: am24
22 Replies

10. Shell Programming and Scripting

Extract between two Exact matched strings.

more data.txt i need this exacted from data.txt This is the command i tried sed -n "/Start_of_DISK_info:\/u/,/End_of_DISK_info:\/u/p" data.txtBut, unfortunately it does not do an exact match. Instead, it prints text between both these strings /u & /u/tmp like below. i need this... (6 Replies)
Discussion started by: mohtashims
6 Replies
XSTOW.INI(5)						       XStow Reference Guide						      XSTOW.INI(5)

NAME
xstow.ini, config file for XStow CONTENT
The xstow.ini file contains some static informations about your system. It's possible setting most necessary values by setting the required command line option, but in some cases this won't make sense if you are using xstow quite often. SYNTAX
The syntax of the configuration file is simple. It's the same as it is used by KDE and GNOME. The data is splitted into keys values and sections. The '#' sign marks a comment. Here is an example: [traserve-links] keep-targets = true link = /usr/tmp # comment [traserve-links] is a section with the name "traserve-links" keep-targets = true is a key - value pair, where 'keep-targets' is the key and 'true' is the value. PROCESSING
XStow processes the config files one after another. Static configuration options like the [debug]=>module option can be overwritten by the next config file. List keys like [traverse-links]=>link will be appended to the list. If you wan't more informations about the current stow setup call XStow like this: xstow -s -dl 1 dummy-package | less For getting information about which config files were processed you will have to set some environment values (see xstow(1) for details). Eg.: XSTOW_DEBUG_LEVEL=1 xstow -s -dl 1 dummy-package | less DESCRIPTION
SECTION traserve-links In this section a number of links are listed, which xstow will identify as links that are not part of an xstow managed package. Eg.: For conforming to the FHS it is common setting a link from /usr/share/man to /usr/man. This will cause old applications installing theire manpages in /usr/share/man, rather than in /usr/man. But xstow is paranoid and believes that the link contains to something else and it is not allowed writing data into the directory the link points to. The simple solution is telling xstow which links should be handled as normal directories. These links can be listed in this section. link = LINK The value of this key must contain an absolute path to the link that should be handled as a normal directory. The link itself can be an absolute, or relativ link. It is allowed that there are more than one link keys in this section. keep-targets = BOOL Allowed values are 'true' and '1' (incasesensitive). Anything else will be interpreted as false. If keep-targets is set to true the target of the links in this section will automatically added to the keep-dirs section. This avoids that these targets will be removed and the links will become dead links. add-if-target = PATTERN Automatic add all links which targets match the pattern to the link list. XStow will use this as the last chance for solving dependencies. Only if all other tests failed the application will try appling this test. This means that it is no problem setting [links]=>absolute-links to true and using a pattern like /* here. If keep-targets is set to true the applied links will added to the keep-dirs list too. add-if-target-regex = REGEX Does the same as add-if-target, but support regular expressions. XStow will always try matching the regular expressions before the normal shell patterns, cause a regex can be much more exact than a shell pattern. SECTION keep-dirs In this section directories are listed that should not be remove. When xstow removes a package and a directory becomes emty the directory will be removed too. dir = DIR The value of this key must contain an absolute path to the directory that should be kept. It is allowed that there are more than one dir keys in this section. The value should not end with a '/'!! SECTION matches XStow will try matching this pattern to all file names that were found in packages. Only the file names. So you do not have to care about the slashes. ignore = PATTERN Ignore files matching this pattern. It is allowed that there are more than one ignore keys in this section. ignore-regex = REGEX Does the same as ignore, but support regular expressions. XStow will always try matching the regular expressions before the normal shell patterns, cause a regex can be much more exact than a shell pattern. copy = PATTERN Copy files or directories matching this pattern instead of linking it. This makes sense in case of some global files that will be used by more than one package and will be updated in the course of the installation process. Files that were installed this way won't be removed in case of unstowing a package, since XStow can not handle package dependencies and does not know if any other package requires the file. If a directory matches this expression the content of the directory will be copied recoursively. This can be useful in case of some /etc files, installed by the installation process. It is allowed that there are more than one copy keys in this section. copy-regex = REGEX Does the same as copy, but support regular expressions. XStow will always try matching the regular expressions before the normal shell patterns, cause a regex can be much more exact than a shell pattern. nignore = NIGNORE_RULE Ignore everything except file and directories matching this expression. eg: "systree/bintree". For using nignore support fnmatch and configration file support has to be enabled. A rule (eg.: "systree/headertree" ) has a set of subrules (eg.: "systree" and "headertree" ). These subrules are defined in a separate section which is named as the subrule. Eg, the subrule for "systree": [systree] dir = /usr dir = /usr/local follow = false There is an example config file "nignore.ini" in the doc directory of this package. SECTION NIGNORE-SUB-RULE Description of a nignore subrule. This section is called like the nignore subrule, eg: "systree". dir = DIR Directories where a file of the package should be installed. You can use shell pattern's too (eg.: "/man/man*"), but use this feature only if this subrule is the last one in an nignore rule. follow = BOOL Follow subdirs. SECTION stow-dirs dir = DIR The value of this key must contain an absolute path to the directory that can be handled as it would be part of the own stow directory. This means xstow is allowed to make changes in packages that are related to this directory. It is allowed that there are more than one dir keys in this section. The value should not end with a '/'!! auto-add-dirs = PATTERN Automatically add a directory if it matches this pattern. In Stow directories, which were detected with this pattern, never will be searched for configuration files. It is allowed that there are more than one auto-add-dirs keys in this section. auto-add-dirs-regex = REGEX Does the same as auto-add-dirs, but support regular expressions. XStow will always try matching the regular expressions before the normal shell patterns, cause a regex can be much more exact than a shell pattern. SECTION protect-dirs The goal of this section is limiting the access within a legal target directory. Eg.: If your stow directory is '/stow' and you installing packages this way: make install DESTDIR=/stow/package_name But the 'prefix' is set to '/usr/local'. In this case target directory will be '/', but the real target directory of package will be '/usr/local'. The following keys withing this section allowing to restrict the installation access within the valid target directory. dir = DIR The value of this key must contain an absolute path to the directory that has not be changed. XStow is not allowed installing a package there and withing the subdirectories, and will report an error, if it would. It is allowed that there are more than one dir keys in this section. The value should not end with a '/'!! auto-add-dirs = PATTERN Automatically add a directory if it matches this pattern. It is allowed that there are more than one auto-add-dirs keys in this section. auto-add-dirs-regex = REGEX Does the same as auto-add-dirs, but support regular expressions. XStow will always try matching the regular expressions before the normal shell patterns, cause a regex can be much more exact than a shell pattern. target = DIR The value of this key must contain an absolute path to the directory that is allowed to be changed. If this value is set, XStow will report an error if it would touch any other, or upper directory within the tree. It is allowed that there are more than one target keys in this section. The value should not end with a '/'!! target-add-traversable-links = BOOL Automatically add the targets of traversable links to the targets list. This can be useful if you do not add manually all possible targets of traversable links to the target list. By default this value is set to false. If your stow directory is '/stow' and all packages should be installed in '/usr/local/' such a config file will make sense: [traverse-links] link = /usr/local/etc [protect-dirs] target = /usr/local target-add-traversable-links = true XStow will report an error if it would install a package outside of '/usr/local' SECTION debug These values will be ignored if one of these values is set by command line option. module = MODULE Set the default debug module. level = INTEGER Set the debug level. SECTION config-files in-home = BOOL Search in home directory for a config file named "xstow.ini" or ".xstow.ini". Only in the home directory will be searched for hidden files. in-stow-dir = BOOL Search in current stow directory for a config file in-other-stow-dirs = BOOL Search in other public stow directories for config files. file = FILE Read this config file too. It is allowed that there are more than one file keys in this section. SECTION links absolute-paths = BOOL Create links with absolute path names. SECTION exec If a package comes with some GNU info files, install-info creates an index directory named 'dir' in STOWDIR/PACKAGE/share/info. If this is the first package with an info index file this won't be a problem. If a second package creates another 'dir' file in the packages info directory, this file will not contain the informations from the first package too and xstow will report a problem unless you use the ignore or copy option. But using the copy option is not a solution since the content of each of the files is incomplete. You can use the ignore option and run mkinfodir in the /usr/local/info directory after installing the package with xstow. (Such a script is available on various distributions.) The other solution is running a program that merges the old and the new 'dir' file. This section provides a hook, that allows executing such tools if a file or directory matches a condition. XStow shippes a programm called merge-info(1) that can be used this way. There can be more than one exec Section within an ini file! match = PATTERN exec = COMMAND Executes the command if a file matches the match expression. %t is replaces by the target file and %s is replaced by the source file. exec-unstow = COMMAND Executes the command if a file matches the match expression and a packages is unstowed. If exec-unstow is not set and a package will be unstowed, nothing will be executed. %t is replaces by the target file and %s is replaced by the source file. EXAMPLE xstow.ini EXAMPLE 1 Here is an example xstow.ini which is common for a system where xstow is managing the /usr/local tree. [traverse-links] keep-targets = true link = /usr/local/tmp link = /usr/local/var link = /usr/local/man link = /usr/local/doc link = /usr/local/info [keep-dirs] dir = /usr/local/bin dir = /usr/local/sbin dir = /usr/local/lib dir = /usr/local/include [matches] ignore = *~ ignore = core ignore = core.* ignore = CVS [exec] match = dir # GNU info index file exec = merge-info %t %s -o %t exec-unstow = merge-info -u %t %s -o %t [stow-dirs] dir = /usr/local/stow dir = /usr/local/stow2 EXAMPLE 2 This is an example xstow.ini for a system where xstow is managing the '/usr/local' tree, but the stow directory is '/stow'. [matches] ignore = *~ ignore = CVS ignore = core* [stow-dirs] dir = /stow [protect-dirs] target = /usr/local SEE ALSO
xstow(1) merge-info(1) xstow.ini file. XStow 1.0.0 2012-05-29 XSTOW.INI(5)
All times are GMT -4. The time now is 04:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy