Search Results

Search: Posts Made By: 47shailesh
3,394
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,758
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,320
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,645
Posted By 47shailesh
you missed space after [ and before ]
you missed space after [ and before ]
1,645
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,326
Posted By 47shailesh
use maxdepth option with find
use maxdepth option with find
9,248
Posted By 47shailesh
echo ${var//^/_}
echo ${var//^/_}
10,273
Posted By 47shailesh
explore...
explore https://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
2,287
Posted By 47shailesh
awk -F\" '{print $4}' infile
awk -F\" '{print $4}' infile
1,220
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,552
Posted By 47shailesh
please post some input sample and expected output.
please post some input sample and expected output.
2,292
Posted By 47shailesh
if grep -q 627857272120951075 abc.log then ...
if grep -q 627857272120951075 abc.log
then
echo "present"
else
echo "no joy"
fi
1,014
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,521
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,521
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,736
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,837
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,987
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,291
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,291
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,097
Posted By 47shailesh
awk -F\" '{print $2}' infile > outfileORcut -d \"...
awk -F\" '{print $2}' infile > outfileORcut -d \" -f 2 infile > outfile
1,097
Posted By 47shailesh
awk -F, '{print $1}' infile > outfilecut -d , -f...
awk -F, '{print $1}' infile > outfilecut -d , -f 1 infile > outfile
1,047
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,047
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,950
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 06:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy