Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find EXACT word in files, just the word: no prefix, no suffix, no 'similar', just the word Post 302613859 by Freddythunder on Wednesday 28th of March 2012 02:26:57 AM
Old 03-28-2012
I am totally brand new to this so don't get mad if I'm wrong... But when I'm looking through the maillog for my name in a line, I do this:
# more maillog | grep "freddy"
which is what I think you're doing now. Have you tried putting the white space in the serach like " freddy "? I know that if you want to match spaces on either side you can use escaped s "\s" but have no example.
This User Gave Thanks to Freddythunder For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can a shell script pull the first word (or nth word) off each line of a text file?

Greetings. I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies

2. Shell Programming and Scripting

find a word in a file, and change a word beneath it ??

Hi all, I have a file with lines written somewhat like this. aaaa ccc aa linux browse = no xssxw cdcedc dcsdcd csdw police dwed dwd browse = no cdecec (2 Replies)
Discussion started by: vikas027
2 Replies

3. Shell Programming and Scripting

Find Exact word in file

Hi ALL, I want to search one string “20 “ i.e 20 with space. But my file where I am searching this “20 “ contain some data like 120 before image file truncated 220 Reports section succeeded 20 Transaction database .prd stopped 220 Reports section completed. When I search for the... (5 Replies)
Discussion started by: Jeevan Salunke
5 Replies

4. UNIX for Dummies Questions & Answers

Script to search for a particular word in files and print the word and path name

Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name". Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies

5. Shell Programming and Scripting

Find and replace a word in all the files (that contain the word) under a directory

Hi Everyone, I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap". For Example: In the Directory, $pwd /home/nick $ grep -l "xsgd1234dap" *.sh | wc -l 119 I have "119" files that are still using... (5 Replies)
Discussion started by: filter
5 Replies

6. Shell Programming and Scripting

Compare two files word by word

I need to compare two files word by word using unix shell scripting. Could someone help me? I need the code which will compare the 1st word from file1 with 1st word from file2, 2nd word from file1 with 2nd word from file2 etc..., for all the lines. Example: File1: aaa bbb ccc ... (7 Replies)
Discussion started by: rsmohankumar
7 Replies

7. Shell Programming and Scripting

perl lwp find word and print next word :)

hi all, I'm new there, I'm just playing with perl and lwp and I just successfully created a script for log in to a web site with post. I have a response but I would like to have something like this: I have in my response lines like: <div class="sender">mimi020</div> <some html code.....>... (3 Replies)
Discussion started by: vogueestylee
3 Replies

8. Shell Programming and Scripting

Shell Script @ Find a key word and If the key word matches then replace next 7 lines only

Hi All, I have a XML file which is looks like as below. <<please see the attachment >> <?xml version="1.0" encoding="UTF-8"?> <esites> <esite> <name>XXX.com</name> <storeId>10001</storeId> <module> ... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies

9. Shell Programming and Scripting

Find word in a line and output in which line the word occurs / no. of times it occurred

I have a file: file.txt, which contains the following data in it. This is a file, my name is Karl, what is this process, karl is karl junior, file is a test file, file's name is file.txt My name is not Karl, my name is Karl Joey What is your name? Do you know your name and... (3 Replies)
Discussion started by: anuragpgtgerman
3 Replies

10. Shell Programming and Scripting

Find a word and increment the number in the word & save into new files

Hi All, I am looking for a perl/awk/sed command to auto-increment the numbers line in file, P1.tcl: run_build_model sparc_ifu_dec run_drc set_faults -model path_delay -atpg_effectiveness -fault_coverage add_delay_paths P1 set_atpg -abort_limit 1000 run_atpg -ndetects 1000 I would like... (6 Replies)
Discussion started by: jypark22
6 Replies
POLICYKIT.CONF(5)                                                 PolicyKit.conf                                                 POLICYKIT.CONF(5)

NAME
PolicyKit.conf - PolicyKit configuration file DESCRIPTION
The /etc/PolicyKit/PolicyKit.conf configuration file provides a way for system administrators to override policy for mechanisms that use the PolicyKit library to determine whether a caller is allowed to use the mechanism. Changes to this configuration file are immediately propagated to running processes using the PolicyKit library. If the configuration file is invalid, processes using this library will log this fact to the system logger and the library will only only return no as the answer to processes using it. The polkit-config-file-validate(1) tool can be used to verify that the configuration file is valid. FILE FORMAT
The configuration file is an XML document. It must have the following doctype declaration: <!DOCTYPE pkconfig PUBLIC "-//freedesktop//DTD PolicyKit Configuration 1.0//EN" "http://hal.freedesktop.org/releases/PolicyKit/1.0/config.dtd"> The following elements may be present in the configuration file: config This is the root element. A single attribute version must be present and must be set to "0.1" at this point. There can only be one config element in the configuration file. match This element is for matching information related to the decision making process and includes values describing both the caller and the action. This element can be embedded in both config and other match elements (hence allowing for nested matching). There can only be a single attribute in each match element and POSIX Extended Regular Expression syntax are supported in the value part. The following attributes are supported: user This matches on the users login name. action For matching on the given action being queried for, for example action="org.foo.*" will match on all actions whose action identifier begins with the string "org.foo.". return This element is for used to specify what result the PolicyKit library will return. It can only be embedded in config and match elements and can embed no elements itself. The return element is typically used deeply inside a number of match elements. A single attribute, result is supported and it can assume the following values: no Access denied. auth_self Access denied, but authentication of the caller as himself will grant access to only that caller. auth_self_keep_session Access denied, but authentication of the caller as himself will grant access to any caller in the session of the caller belongs to. auth_self_keep_always Access denied, but authentication of the caller as himself will grant access any caller with the given uid in the future. auth_admin Access denied, but authentication of the caller as an administrative user will grant access to only that caller. auth_admin_keep_session Access denied, but authentication of the caller as an administrative user will grant access to any caller in the session of the caller belongs to. auth_admin_keep_always Access denied, but authentication of the caller as an administrative user will grant access any caller with the given uid in the future. yes Access granted. define_admin_auth This element is used to specify the meaning of "authenticate as administrator". It is normally used at the top-level but can also be used deep inside a number of match elements for conditional behavior. There can only be a single attribute in each define_admin_auth element. POSIX Extended Regular Expression syntax is not supported in the value part, however multiple values to match on can be separated with the bar (|) character. The following attributes are supported: user Administrator authentication means authenticate as the given user(s). If no define_admin_auth element is given, the default is to use user="root" e.g. administrator authentication mean authenticate as the super user. group Administrator authentication means that any user in the groups matching the given value can be used to authenticate. Typically, on a system with the root account disabled one wants to use something like group="wheel" to e.g. enable all UNIX users in the UNIX group wheel to be able to authentication whenever administrator authentication is required. EXAMPLES
For brevity, the standard XML and DOCTYPE headers as well as the top-level config are omitted in the following configuration file examples. The actions used may also be fictional, use polkit-action(1), to learn about the actions available on your system. ALLOW EVERYTHING The users "davidz" and "bateman" are allowed to do any action: <match user="davidz|bateman"> <return result="yes"/> </match> MOUNTING FIXED DRIVES Suppose the action org.freedesktop.hal.storage.mount-fixed is used to determine whether mounting internal hard drives are allowed. Then this configuration file <match action="org.freedesktop.hal.storage.mount-fixed"> <match user="davidz"> <return result="yes"/> </match> <match user="freddy"> <return result="no"/> </match> </match> specifies that user "davidz" is always allowed to do the action, while user "freddy" is never allowed to do the action. Other users will be subject to the defaults results specified in the .policy file describing the action. AVOIDING THE ROOT PASSWORD Suppose the group wheel contains the users on a system who are allowed to carry out administrative tasks (ie. tasks that would usually require the root password) on a system where the root account is disabled. Then <define_admin_auth group="wheel"/> can be used to specify that users in said group can authenticate using their own password in instances where the system would normally prompt for the root password. AUTHOR
Written by David Zeuthen david@fubar.dk with a lot of help from many others. BUGS
Please send bug reports to either the distribution or the hal mailing list, see http://lists.freedesktop.org/mailman/listinfo/hal. to subscribe. SEE ALSO
PolicyKit(8), polkit-config-file-validate(1), polkit-action(1), polkit-auth(1) PolicyKit August 2007 POLICYKIT.CONF(5)
All times are GMT -4. The time now is 03:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy