for i in `ls cdr.30_JUL_2012*`; do perl -e 'while(<>) {@fields=split(/\|/,$_);$fields[5]="hello";for($i=0;$i <= $#fields; $i++){ print "$fields[$i]|";}}' $i > hello.$i; done &
Tuesday, 31 July 2012
Monday, 30 July 2012
Read line from file1 and search string in other files
IFS='/'; while read line ; do { arr=($line); exp="${arr[1]}${arr[2]}"; tmp=`echo $exp | sed -e 's/"//'`; if [ -z $tmp ]; then continue; fi; len=`expr length $tmp`; if [ $len -gt 30 ]; then grep "${arr[1]}/${arr[2]}" mig_proxy.cdr.26_JUL_2012_mig* | grep -v ${arr[0]}; fi } done < cdr.26_JUL_2012* > report.26_JUL_2012 2>&1
--brief: read line from has delimited by "/" and take third splitted str and search string in other files
--brief: read line from has delimited by "/" and take third splitted str and search string in other files
Friday, 27 July 2012
Multiply two intergers using bitwise operator
#include<stdio.h>
void main()
{
int a,b,result;
printf("Enter the numbers to be multiplied :\n");
scanf("%d%d",&a,&b);
result=0;
while(b != 0)
{
if (b&0x01)
{
result=result+a;
}
a<<=1;
b>>=1;
}
printf("Result:%d",result);
}
void main()
{
int a,b,result;
printf("Enter the numbers to be multiplied :\n");
scanf("%d%d",&a,&b);
result=0;
while(b != 0)
{
if (b&0x01)
{
result=result+a;
}
a<<=1;
b>>=1;
}
printf("Result:%d",result);
}
Subscribe to:
Posts (Atom)