Search Results

Search: Posts Made By: Bijayant Kumar
4,522
Posted By Bijayant Kumar
I want whole line which contains...
I want whole line which contains "sasl_username=name@xyz.com". Where name can be anything ie any name on the planet. And I think the above command is doing that thing. What do you say?
4,522
Posted By Bijayant Kumar
Solved
Thanks. My requirement is half solved from your all help. I will return soon with my next queries of second stage related to my program.

Forum rocks !!!!!
4,522
Posted By Bijayant Kumar
I found the solution of my own question... ...
I found the solution of my own question...

awk '/sasl_username=/ && /xyz.com/' maillog.txt


This line contains queue id in the 6th field. I am trying to have that value like

awk...
4,522
Posted By Bijayant Kumar
First thanx for the reply. I think I was not...
First thanx for the reply. I think I was not clear in my question. There will be n number of lines besides

Dec 12 03:15:28 postfix/smtpd[550]: 3F481EB0295: client=unknown[x.x.x.x],...
4,522
Posted By Bijayant Kumar
extract based on pattern
I have a mail log file and I want to extract some lines belonging to one domain. For example

Input File:


Dec 12 03:15:28 postfix/smtpd[550]: 3F481EB0295: client=unknown[x.x.x.x],...
3,112
Posted By Bijayant Kumar
bijayant@bijayant ~ $ cat test hi this is...
bijayant@bijayant ~ $ cat test
hi this is bijayant 17
Received message 17
17 Received message
18 Received message
19 Received message
Bijayant Received message
Bijayant 17 Received message
17...
4,612
Posted By Bijayant Kumar
And if you need output to the file at the same...
And if you need output to the file at the same time then
grep -l 'pattern to match goes here' /var/allogs/*.log | tee output.txt
3,520
Posted By Bijayant Kumar
Oopss...sorry,sorry such a silly typo It...
Oopss...sorry,sorry such a silly typo

It will be
bijayant@bijayant ~ $ grep -o mad test | echo "be mad"
be mad
3,520
Posted By Bijayant Kumar
bijayant@bijayant ~ $ cat test main string is...
bijayant@bijayant ~ $ cat test
main string is madhu

bijayant@bijayant ~ $ grep -o mad test2 | echo "be mad"
be mad
4,696
Posted By Bijayant Kumar
This code should be like this cat test |sed...
This code should be like this

cat test |sed -e 's/^.*+//g'|tr -d "\t"

It will take care any number of "tabs" or "spaces" present before the "+" sign. No matter its a "space or tabs". It will...
4,696
Posted By Bijayant Kumar
First of all, i am sorry to say that i didnt...
First of all, i am sorry to say that i didnt understood ur problem , but whatever i understood

cat test
+ T 40

cat test | tr -d " " | sed -e 's/^./ /g;s/\( \)\(.\)/\1\2 /'
T 40
12,840
Posted By Bijayant Kumar
echo 'AAAACCCCBBBB.txt' | sed...
echo 'AAAACCCCBBBB.txt' | sed 's/^.*\(...\)\..*/\1/'
sed 's/^.*\(...\) --> you understood till this part right??

\..* --> this is string after the ".". In this case anything after dot ( . )...
4,659
Posted By Bijayant Kumar
May be this can help you a little bit ...
May be this can help you a little bit

bijayant@bijayant~ $ cat testfile
new 1: insert into sapr3.sdbah values ('20080927210501','net','DB','0','20080928084821','netbackup')

bijayant@bijayant...
4
3,916
Posted By Bijayant Kumar
Ohh cool.... then it is much easier now.. i was...
Ohh cool.... then it is much easier now.. i was not aware of this.. thanks

Now the command will look like
awk -F: -v user="$name" '$1 == user{print $1":*RM*" $2 ":" $3 ":" $4 ":" $5 ":" $6 ":" $7...
4
3,916
Posted By Bijayant Kumar
1. For this you need to grep first that user name...
1. For this you need to grep first that user name then pipe it to awk command.
or you can try this command also
grep "$name" /etc/shadow | sed...
2,031
Posted By Bijayant Kumar
Every day at 6 am. see man crontab
Every day at 6 am.
see man crontab
2,340
Posted By Bijayant Kumar
If you will replace comma(,) with newline then...
If you will replace comma(,) with newline then you can use awk to get number of occurrence of 'abc' like this :-

cat testfile | tr "," "\n" | awk /abc/ | wc -l

sed 's/,/\n/g' testfile | awk...
11,167
Posted By Bijayant Kumar
You can try in this way also, if you dont want...
You can try in this way also, if you dont want that '>' and '<' in the lines

1. sdiff file1 file2 | tr -s ' <' '\t' | tr -s ' >' '\t'
and
2. sdiff file1 file2 | sed -e's/ <//g;s/\t/ /g;s/ >/\t/g'
18,468
Posted By Bijayant Kumar
You can try this also grep -lr '^A$' ../ |...
You can try this also

grep -lr '^A$' ../ | xargs ls -l | awk '{print$1 " " $9}'
Showing results 1 to 19 of 19

 
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy