Search Results

Search: Posts Made By: 47shailesh
4,983
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
4,225
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 &...
6,000
Posted By 47shailesh
you can use awk '{print "10.0.0.1" "," $0}'...
you can use awk '{print "10.0.0.1" "," $0}' infile
2,027
Posted By 47shailesh
you missed space after [ and before ]
you missed space after [ and before ]
2,027
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
6,737
Posted By 47shailesh
use maxdepth option with find
use maxdepth option with find
9,779
Posted By 47shailesh
echo ${var//^/_}
echo ${var//^/_}
10,700
Posted By 47shailesh
explore...
explore https://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
3,413
Posted By 47shailesh
awk -F\" '{print $4}' infile
awk -F\" '{print $4}' infile
1,373
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,786
Posted By 47shailesh
please post some input sample and expected output.
please post some input sample and expected output.
2,485
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,322
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
3,161
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
3,161
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,921
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...
3,137
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
2,215
Posted By 47shailesh
awk -F"\t" '{print $1","$2","$3"\t"$4" "$5}'...
awk -F"\t" '{print $1","$2","$3"\t"$4" "$5}' infile
13,908
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...
13,908
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,194
Posted By 47shailesh
awk -F\" '{print $2}' infile > outfileORcut -d \"...
awk -F\" '{print $2}' infile > outfileORcut -d \" -f 2 infile > outfile
1,194
Posted By 47shailesh
awk -F, '{print $1}' infile > outfilecut -d , -f...
awk -F, '{print $1}' infile > outfilecut -d , -f 1 infile > outfile
1,166
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,166
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.
3,444
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 04:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy