Search Results

Search: Posts Made By: 47shailesh
1,663
Posted By 47shailesh
you missed space after [ and before ]
you missed space after [ and before ]
2,332
Posted By 47shailesh
awk -F\" '{print $4}' infile
awk -F\" '{print $4}' infile
1,232
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,036
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,870
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,119
Posted By 47shailesh
awk -F, '{print $1}' infile > outfilecut -d , -f...
awk -F, '{print $1}' infile > outfilecut -d , -f 1 infile > outfile
1,056
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,799
Posted By 47shailesh
sorry bad post
sorry bad post
1,038
Posted By 47shailesh
awk way awk '$3 ~ /@GDF_INPUT/{print $0 >>...
awk way
awk '$3 ~ /@GDF_INPUT/{print $0 >> "File1"}; $3 ~ /@FF_INPUT/{print $0 >> "File2"}' infile
1,272
Posted By 47shailesh
something like this tr -s " " "\n" < infile |...
something like this
tr -s " " "\n" < infile | egrep -o "loginIdPattern.*|orgIdPattern.*"
832
Posted By 47shailesh
you've to add space after [ and before ] if [...
you've to add space after [ and before ]
if [ $? -eq 0 ]; then
3,335
Posted By 47shailesh
what error you are getting ?
what error you are getting ?
2,089
Posted By 47shailesh
One error is due to value with leading space...
One error is due to value with leading space entered by user. Also I made few correction in your script.
echo -n "ENTER VALUE BETWEEN 01-31 "
read value
count=`tail -1 filecount.txt | tr -d " "` ...
2,531
Posted By 47shailesh
if you use 20 it will touch every 20th file and...
if you use 20 it will touch every 20th file and that's why number of new files are less.
for 20% use [ `expr $N % 5` -eq 0 ].
2,742
Posted By 47shailesh
I agree with Corona, and for Solaris use this...
I agree with Corona, and for Solaris use this insteadtail -$(sort -u -t"|" -k1,1 infile | wc -l) infileor /usr/xpg4/bin/tail -n $(sort -u -t"|" -k1,1 infile | wc -l) infileI would recommend...
2,742
Posted By 47shailesh
one way can be: tail -n $(sort -u -t"|" -k1,1...
one way can be:
tail -n $(sort -u -t"|" -k1,1 infile | wc -l) infile
1,273
Posted By 47shailesh
assuming your column is 1 use following awk...
assuming your column is 1 use following

awk '{x+=$1} END {print x}' infile
4,526
Posted By 47shailesh
ls $FILE | grep -v "$UPPDATE" will list files...
ls $FILE | grep -v "$UPPDATE" will list files other than todays date check -v option of grep.
Other alternative to delete such files is
find $FILE -maxdepth 1 ! -name \*"$UPPDATE"* -exec rm {} \;
3,203
Posted By 47shailesh
This is what the above code is doing: ...
This is what the above code is doing:


Reading filename and retention from a file.
Doing a month to day conversion with wrong syntax.
Not sure what the use of all_files variable, later...
4,526
Posted By 47shailesh
thanks for pointing it out, made appropriate...
thanks for pointing it out, made appropriate correction in post#2
4,526
Posted By 47shailesh
loose the quotes and ^ . Quotes wont allow your...
loose the quotes and ^ . Quotes wont allow your variable to expand, and ^ searches for file name starting with variable name, which in your case is at the end/middle. use following
ls $FILE | grep...
4,881
Posted By 47shailesh
it should be x>2 because for 1st column ($i>=3)...
it should be x>2 because for 1st column ($i>=3) returns true, so "x" increments 1 for 1st column.
6,269
Posted By 47shailesh
sed -e 's:www.test.com:www.test1.com:g' -e...
sed -e 's:www.test.com:www.test1.com:g' -e 's:test.com:New website is test1.com:g' infile
1,902
Posted By 47shailesh
you need to define variable in awk so that it can...
you need to define variable in awk so that it can understand:

ps -ef | awk -v name="$nFName" '{if ($2 == name) print $1 " " $2 " " $3 " " $9 " " $10 " " $11 " " $12 " " $13;}'
6,198
Posted By 47shailesh
echo "My zip code is 24490" | awk '{print $NF}'...
echo "My zip code is 24490" | awk '{print $NF}' >>tempfile
Showing results 1 to 25 of 37

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