Search Results

Search: Posts Made By: 47shailesh
1,151
Posted By 47shailesh
can you post a sample of the file and required...
can you post a sample of the file and required output ?
Forum: UNIX and Linux Applications 02-12-2013
1,564
Posted By 47shailesh
@before4 you didn't mentioned how you'll use the...
@before4 you didn't mentioned how you'll use the logs.

In my opinion storing in mysql is better than flat files. querying become really easy.
Make sure to partition your table like on date &...
2,684
Posted By 47shailesh
you can use awk '{print "10.0.0.1" "," $0}'...
you can use awk '{print "10.0.0.1" "," $0}' infile
942
Posted By 47shailesh
you missed space after [ and before ]
you missed space after [ and before ]
942
Posted By 47shailesh
mising brackets if [ "$VAR" == 'icmp_req=5'...
mising brackets if [ "$VAR" == 'icmp_req=5' ]
Forum: UNIX and Linux Applications 07-19-2012
3,121
Posted By 47shailesh
use maxdepth option with find
use maxdepth option with find
5,012
Posted By 47shailesh
echo ${var//^/_}
echo ${var//^/_}
6,322
Posted By 47shailesh
explore...
explore https://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
1,693
Posted By 47shailesh
awk -F\" '{print $4}' infile
awk -F\" '{print $4}' infile
854
Posted By 47shailesh
"then" is missing after second "if" condition. ...
"then" is missing after second "if" condition.

also you can reduce some code by using following grep "^SOME_CMD.*ext$" infileWhy do you want to echo the config file name on match found ?
1,926
Posted By 47shailesh
please post some input sample and expected output.
please post some input sample and expected output.
1,985
Posted By 47shailesh
if grep -q 627857272120951075 abc.log then ...
if grep -q 627857272120951075 abc.log
then
echo "present"
else
echo "no joy"
fi
669
Posted By 47shailesh
use mailx mailx -s "my logs" -a abc.log ...
use mailx

mailx -s "my logs" -a abc.log sara@somewhere.com < emailbody
OR
( cat emailbody ; uuencode abc.log abc.log ) | mailx -s "my logs" sara@somewhere.com
1,646
Posted By 47shailesh
post what command you are using. Did you tried...
post what command you are using. Did you tried what is suggested in post #3
1,646
Posted By 47shailesh
you could use for your sample data sort -k1,1...
you could use for your sample data sort -k1,1 -k2,2 -k4,4 infile
but ideally you should use sort -k1,1 -k4,4 -k2,2 infile
1,318
Posted By 47shailesh
In absence of hash/actual file size/record count,...
In absence of hash/actual file size/record count, One possible way to detect complete download is to check size of downloading file in every 2mins, once the file size stop growing you can assume the...
1,557
Posted By 47shailesh
default separator for awk if space. So your 6th...
default separator for awk if space. So your 6th field is "ABC" and 7th is "Company".
Print 6th and 7th both while pulling Customer Name
1,200
Posted By 47shailesh
awk -F"\t" '{print $1","$2","$3"\t"$4" "$5}'...
awk -F"\t" '{print $1","$2","$3"\t"$4" "$5}' infile
6,913
Posted By 47shailesh
you can use this:d=$(date '+%Y%m%d') i=6 ...
you can use this:d=$(date '+%Y%m%d')
i=6
while [ $i -ge 0 ]
do
printf "mv filename_$(expr $d - $i) /move/path/\n"
i=$(expr $i - 1)
donereplace printf with mv command if this code does get...
6,913
Posted By 47shailesh
in what format the files have date. Also which OS...
in what format the files have date. Also which OS and shell your are using
712
Posted By 47shailesh
awk -F\" '{print $2}' infile > outfileORcut -d \"...
awk -F\" '{print $2}' infile > outfileORcut -d \" -f 2 infile > outfile
712
Posted By 47shailesh
awk -F, '{print $1}' infile > outfilecut -d , -f...
awk -F, '{print $1}' infile > outfilecut -d , -f 1 infile > outfile
738
Posted By 47shailesh
or you can do like this$cat infile dan 1000 ...
or you can do like this$cat infile
dan 1000
john 1200
jim 100
marc 5000
hazel 25
mitch 5000
incr=5000
awk -v bal="$incr" '$1=="dan" && $2=$2+bal;$1!="dan"' infile
738
Posted By 47shailesh
Can you pls post some input that support your...
Can you pls post some input that support your requirement and desired output.
1,916
Posted By 47shailesh
your expected output will have following two also...
your expected output will have following two also rt?titleB
titleDtry thisgrep -v titlex infile
Showing results 1 to 25 of 200

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