I tried this ,but looks like I'm missing something.
Yes. The "problem" is that the (correct) result of the sed command is actually N, notice the preceding whitespace. So right now you are comparing " N" and "N" and thus the result is No.
Solution: Remove that leading whitespace and try again. There are many ways to perform that, I prefer this:
I need to list the files that do not match the search pattern:
Example:
cat file1
This is how it should work
cat file2
This is why I like Unix
grep -option? Unix * (or some other command)
returns file1 (1 Reply)
I need to list the files that do not match the search pattern:
Example:
cat file1
This is how it should work
cat file2
This is why I like Unix
grep -option? Unix * (or some other command)
returns file1 (7 Replies)
Hi, Can you help please.
I have the following comand:
if ]; then
l_valid_string="Y"
fi
The problem I am trying to solve is that my l_string = ABC and my file contains
ABC
ABC_EFG
I only want back the value ABC exact match. (3 Replies)
Hi
I need a command to search files in a directory which does not match with pattern .. Plz send me this
Ex : Test is directory and has some 10 files with different name all are with *.dat extension , need to search files which doesnot contain word "Dummy file".
Thanks (6 Replies)
HI please let me know if there is any command to search and replace only the last occurence of a string in aline.
Eg:
" This cat is a cat with a tail longer of all cat."
I need to replace only the last "cat" in the above line.
thanks (3 Replies)
I am trying to match a pattern exactly in a shell script. I have tried two methods
awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath
perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath
Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Dear all,
I have a specific problem that I don't quite understand how to solve. I have two files, both of the same format:
XXXXXX_FIND1 bla bla bla
bla
bla
bla
bla
bla
bla
bla
bla
bla
========
(return)
XXXXXX_FIND2 bla bla bla
bla
bla
bla (10 Replies)
I've been looking through the forums for awhile now and looking at the man page for grep and egrep and not seeming to find this scenario so it might not be possible but figured I'd throw it out to get some ideas.
I'm looking for a way to search a file for 1st match (example below net self) and... (3 Replies)
Hi I want to replace only the last occurance of "union all" in input file with ";"
I tried with sed 's/union all/;/g' in my input file, it replaced in all lines of input file
Eg:
select column1,column2 from test1 group by 2 union all
select column1,column2 from test2 group by 2 union all
... (9 Replies)
I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for:
my.cnf
/bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf
after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies
LEARN ABOUT NETBSD
nisplus_table
NISPLUS_TABLE(5) File Formats Manual NISPLUS_TABLE(5)NAME
nisplus_table - Postfix NIS+ client
SYNOPSIS
postmap -q "string" "nisplus:[name=%s];name.name."
postmap -q - "nisplus:[name=%s];name.name." <inputfile
DESCRIPTION
The Postfix mail system uses optional lookup tables. These tables are usually in dbm or db format. Alternatively, lookup tables can be
specified as NIS+ databases.
To find out what types of lookup tables your Postfix system supports use the "postconf -m" command.
To test Postfix NIS+ lookup tables, use the "postmap -q" command as described in the SYNOPSIS above.
QUERY SYNTAX
Most of the NIS+ query is specified via the NIS+ map name. The general format of a Postfix NIS+ map name is as follows:
nisplus:[name=%s];name.name.name.:column
Postfix NIS+ map names differ from what one normally would use with commands such as niscat:
o With each NIS+ table lookup, "%s" is replaced by a version of the lookup string. There can be only one "%s" instance in a Postfix
NIS+ map name.
o Postfix NIS+ map names use ";" instead of ",", because the latter character is special in the Postfix main.cf file. Postfix
replaces ";" characters in the map name by "," before making NIS+ queries.
o The ":column" part in the NIS+ map name is not part of the actual NIS+ query. Instead, it specifies the number of the table column
that provides the lookup result. When no ":column" is specified the first column (1) is used.
EXAMPLE
A NIS+ aliases map might be queried as follows:
alias_maps = dbm:/etc/mail/aliases,
nisplus:[alias=%s];mail_aliases.org_dir.$mydomain.:1
This queries the local aliases file before the NIS+ file.
SEE ALSO postmap(1), Postfix lookup table manager
README FILES
Use "postconf readme_directory" or "postconf html_directory" to locate this information.
DATABASE_README, Postfix lookup table overview
LICENSE
The Secure Mailer license must be distributed with this software.
AUTHOR(S)
Geoff Gibbs
UK-HGMP-RC
Hinxton
Cambridge
CB10 1SB, UK
Adopted and adapted by:
Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
NISPLUS_TABLE(5)