Search Results

Search: Posts Made By: 47shailesh
3,281
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
2,667
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 &...
5,244
Posted By 47shailesh
you can use awk '{print "10.0.0.1" "," $0}'...
you can use awk '{print "10.0.0.1" "," $0}' infile
1,623
Posted By 47shailesh
you missed space after [ and before ]
you missed space after [ and before ]
1,623
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
5,272
Posted By 47shailesh
use maxdepth option with find
use maxdepth option with find
9,168
Posted By 47shailesh
echo ${var//^/_}
echo ${var//^/_}
10,156
Posted By 47shailesh
explore...
explore https://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
2,234
Posted By 47shailesh
awk -F\" '{print $4}' infile
awk -F\" '{print $4}' infile
1,195
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 ?
2,527
Posted By 47shailesh
please post some input sample and expected output.
please post some input sample and expected output.
2,280
Posted By 47shailesh
if grep -q 627857272120951075 abc.log then ...
if grep -q 627857272120951075 abc.log
then
echo "present"
else
echo "no joy"
fi
993
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
2,450
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
2,450
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,709
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...
2,782
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,955
Posted By 47shailesh
awk -F"\t" '{print $1","$2","$3"\t"$4" "$5}'...
awk -F"\t" '{print $1","$2","$3"\t"$4" "$5}' infile
12,182
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...
12,182
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
1,074
Posted By 47shailesh
awk -F\" '{print $2}' infile > outfileORcut -d \"...
awk -F\" '{print $2}' infile > outfileORcut -d \" -f 2 infile > outfile
1,074
Posted By 47shailesh
awk -F, '{print $1}' infile > outfilecut -d , -f...
awk -F, '{print $1}' infile > outfilecut -d , -f 1 infile > outfile
1,014
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
1,014
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.
2,898
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 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy