Search Results

Search: Posts Made By: anil510
1,938
Posted By cjcox
sed 's/.*://' <datafile.txt
sed 's/.*://' <datafile.txt
1,809
Posted By RudiC
Anchor the pattern :sed -e '/^dns.com$/,+2d' file...
Anchor the pattern :sed -e '/^dns.com$/,+2d' file
mydns.com
11
22
dns.com.au
11
22
LAST LINE
1,809
Posted By radoulov
Try: sed '/^dns\.com$/,+2d' /tmp/temp.txt
Try:
sed '/^dns\.com$/,+2d' /tmp/temp.txt
1,809
Posted By MadeInGermany
sed '/^dns\.com$/ {p;N;N;d;}' /tmp/temp.txt
sed '/^dns\.com$/ {p;N;N;d;}' /tmp/temp.txt
876
Posted By vbe
What do you mean? I added to your code my...
What do you mean? I added to your code my comment:

[root@ser]# perldoc -l File::Scan::ClamAV > /usr/src/asas.txt
# here you redirect...
3,356
Posted By Don Cragun
Have you looked at the inotify_add_watch(2)...
Have you looked at the inotify_add_watch(2) (http://man7.org/linux/man-pages/man2/inotify_add_watch.2.html) man page?
1,658
Posted By RavinderSingh13
Hello anil510, Could you please try...
Hello anil510,

Could you please try following and let me know if this helps.

cat check_cron.ksh
A=`grep -rl maldet /etc/cron*`
echo $A | awk '{split($0, X, " ");}END{if(length(X)== 1){print...
2,238
Posted By Scrutinizer
Try: touch...
Try:
touch "/usr/src/${var}_newfile_with_var.txt"
Otherwise the script will be trying to expand the non-existing variable $var_newfile_with_var. An underscore can be used as part of a variable...
1,608
Posted By Don Cragun
It won't take core of switching the order on the...
It won't take core of switching the order on the first line, but the extra space problem can be resolved simply with:
awk '{print $1,$2,$3 $4}' file
10,512
Posted By RavinderSingh13
Hello, Here is an awk utility. awk...
Hello,

Here is an awk utility.


awk '/\/home\/user\/www/ || /\/home\/user\/mail/ || /\/home\/user\/access_logs/ {next} 1' file_name


Output will be as follows.

...
10,512
Posted By pravin27
sed -i ...
sed -i "/\/home\/user\/access-logs/d;/\/home\/user\/mail/d;/\/home\/user\/www/d" filename
1,052
Posted By chacko193
Try this #!/bin/sh newDeviceID=0 ...
Try this

#!/bin/sh

newDeviceID=0
deviceID=0
slotNum=0

MegaCli64 -PDList -aALL | grep -E 'Enclosure Device ID|Slot Number' > infile
while read line
do
newDeviceID=''
...
1,328
Posted By Don Cragun
Change: echo $varto: echo "$var"
Change:
echo $varto:
echo "$var"
3,817
Posted By pravin27
echo '2013-11-14 03:30:02 [441847]...
echo '2013-11-14 03:30:02 [441847] 1Vgnd4-001qwZ-36 <= user@domain.com U=user P=local S=9797
id=cd3732bbd0fbda5cb16384bb7d5b465d@localhost.localdomain T="Subject Subject Subject"
from...
3,817
Posted By Chubler_XL
try: sed -n 's/.*T="\([^"]*\)".*/\1/p'...
try:

sed -n 's/.*T="\([^"]*\)".*/\1/p' infile

or
awk -F\" '/T=/{print $2}' infile
994
Posted By rajamadhavan
perl -lne 'print $1 if /(\d+\.\d+\.\d+\.\d+)/'...
perl -lne 'print $1 if /(\d+\.\d+\.\d+\.\d+)/' /var/log/maillog
994
Posted By Jotne
awk -F"[][]" '{print $2}' /var/log/maillog ...
awk -F"[][]" '{print $2}' /var/log/maillog
55.66.77.88
961
Posted By RudiC
Try alsoawk '{gsub (/[][]/,""); print "alias...
Try alsoawk '{gsub (/[][]/,""); print "alias "$1"=\047ssh "$3"@"$2"\047"}' RS="" file
alias server.domain.com='ssh yyyyyyuser@11.22.33.44'
1,482
Posted By bakunin
This is basically the same as mine (see post #2...
This is basically the same as mine (see post #2 above). The character range "[[:blank:]]" MadeInGermany uses is common, but not required by the standard to be understood. If your system understands...
1,482
Posted By MadeInGermany
sed 's/^[[:blank:]]*//' infile > outfile while...
sed 's/^[[:blank:]]*//' infile > outfile
while read line; do echo "$line"; done < infile > outfile
1,482
Posted By Yoda
awk 'NF{A[++c]=$1}END{for(i=1;i<=c;i++) print...
awk 'NF{A[++c]=$1}END{for(i=1;i<=c;i++) print (!(i%3)?A[i] RS:A[i])}' file
1,482
Posted By Just Ice
make sure you support Unix.com and a local...
make sure you support Unix.com and a local charity ...
awk '{print $1}' /dir/file
3,606
Posted By Jotne
echo "2013-06-11 23:55:14 [17780]...
echo "2013-06-11 23:55:14 [17780] 1Umexd-0004cm-IG <= user@domain.com XXX YY ZZZ" | awk -F"<= " '{split($2,a," ");print a[1]}'
user@domain.com
3,606
Posted By Jotne
Different way to enter field separator awk...
Different way to enter field separator
awk -F"<= " '{print $2}'
awk '{print $2}' FS="<= "

another way
awk '{split($0,a,"<= ");print a[2]}'
3,606
Posted By rajamadhavan
awk 'BEGIN{FS="<= ";}{print $2}'
awk 'BEGIN{FS="<= ";}{print $2}'
Showing results 1 to 25 of 47

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