Search Results

Search: Posts Made By: vish_indian
8,292
Posted By vish_indian
You may want to run a delayed slave for such...
You may want to run a delayed slave for such eventualities in future. Check out pt-slave-delay — Percona Toolkit Documentation...
Forum: Web Development 07-09-2012
2,125
Posted By vish_indian
Apache memory utilization issue
Hi,

I have been running into an issue wherein suddenly an apache process eats up lots of memory and system starts swapping. It causes the server to hang due to io-wait. I am able to trace the...
5,157
Posted By vish_indian
This should work
#!/bin/sh

IRS=" "
num=1
while read var1 var2 var3 var4; do
awk -v var1=${var1} -v var2=${var2} -v var3=${var3} -v var4=${var4} -v num=${num} 'NR>=num{if($1==var1 && $2==var2){ print $0" "var3"...
3,352
Posted By vish_indian
Try changing the pattern a little ...
Try changing the pattern a little



Instead of searching for ",
search for ","
4,865
Posted By vish_indian
Works in Linux :), can't comment about Solaris ...
Works in Linux :), can't comment about Solaris

As per me it should have. What I understand from logic is that

NR==FNR{
nf=(NF>nf) ? NF : nf
next
}

finds out the max value for NF for...
4,865
Posted By vish_indian
This much also works awk 'BEGIN { ...
This much also works

awk 'BEGIN {
FS=OFS=","
}
NR==FNR{
nf=(NF>nf) ? NF : nf
next
}
{NF=nf; print}'



$1=$1 is confusing
3,379
Posted By vish_indian
Another way awk...
Another way

awk '$0~/<\/JOB/?ORS="\n":ORS="|" ' file > newfile
3,310
Posted By vish_indian
Above code is to be executed using root login....
Above code is to be executed using root login. Group must exist, if it doesn't you need to create that first.

All users are listed in /etc/passwd file with uid > 500.


I suggest you study a...
3,310
Posted By vish_indian
You can make those members part of a group and...
You can make those members part of a group and assign execute permission to the group.

eg Supposing group is execute
usermod -G execute feb
chmod 754 /home/august/aug.sh
3,316
Posted By vish_indian
If you have got GNU date and awk/gawk, then...
If you have got GNU date and awk/gawk,

then you can get a backdate with the following command

var=`date +%s`
awk -v var=${var} -v bdays=2 'BEGIN{print strftime("%d-%m-%Y",var-(86400*bdays))}'...
4,371
Posted By vish_indian
An indepth awk tutorial ...
An indepth awk tutorial

http://sunsite.ualberta.ca/Documentation/Gnu/gawk-3.1.0/html_chapter/gawk_toc.html#SEC_Contents
9,157
Posted By vish_indian
sed "s/ /'/g" filename works for me.
sed "s/ /'/g" filename works for me.
3,567
Posted By vish_indian
You can use the find command to search for it. ...
You can use the find command to search for it.


Hope this helps. It might be a link to another directory
9,619
Posted By vish_indian
Here's my sample file called test To...
Here's my sample file called test


To print all values matching pattern:
awk '$0~"test1"' test
or
awk '$0~"test1"{var=$0;print var}' test

To print just the last occurence
awk...
2,117
Posted By vish_indian
You mean something like this: awk 'NR<10{...
You mean something like this:

awk 'NR<10{ print | "sort -t: -k3"}' /etc/passwd

or

awk 'NR<10{ print | "sort -t: -k3 -r"}' /etc/passwd

Its just calling the sort command inside awk, so all...
2,219
Posted By vish_indian
I'll try #!/usr/bin/bash cid=$1 cidname=$2 ...
I'll try
#!/usr/bin/bash
cid=$1
cidname=$2
nawk 'BEGIN {FS="\n"; RS=""; ORS="\n\n"}
{if (NF==1) hdrvar=$0; else if ($0~/'$cid'/) print hdrvar,"\n",$0 }' $cidname


cid=$1 assigns the value...
2,117
Posted By vish_indian
Not sure about any function for sort in awk, but...
Not sure about any function for sort in awk, but you can use the sort command within awk.

e.g.
head /etc/passwd | awk -F":" '{ print | "sort"}'

You don't need awk for this

head /etc/passwd...
3,688
Posted By vish_indian
From what I know * is 0 or more occurrence of the...
From what I know * is 0 or more occurrence of the previous character. Since there is no previous character in expression *.sh , it fails. Not sure which character it assumes there.

Try grep...
3,688
Posted By vish_indian
Try ls | grep ".sh" I created files by...
Try

ls | grep ".sh"

I created files by that name and got the output


* is a special character for grep(used in regular expressions)
8,414
Posted By vish_indian
Firstly, you don't need to use cat and wc -l...
Firstly, you don't need to use cat and wc -l while searching. You can simply use
grep -c 'word' logfile

For searching from a particular line number onwards, you can save the line number in a...
2,194
Posted By vish_indian
change highlighted line to: awk...
change highlighted line to:

awk 'NR>1{split($8,arr,"->");print "Process name\t" $1 "\ton port\t" arr[1]}' | column -t > file1.list
116,383
Posted By vish_indian
Change to lsof -i < ports.list | awk...
Change


to
lsof -i < ports.list | awk 'NR>1{print $1}' | sort | uniq
3,462
Posted By vish_indian
You don't need awk in the above function. Also no...
You don't need awk in the above function. Also no need to create another file numberofiles.list.
You can simply redirect the output of lsof -p $pid to wc -l.
3,462
Posted By vish_indian
Change awk '{print $2}' > fileslist.list to
Change awk '{print $2}' > fileslist.list to
3,462
Posted By vish_indian
as per lsof man page -p requires ","...
as per lsof man page



-p requires "," separated pid list(ie in 1 line). Your file fileslist.list provides them in multiple lines. Either you change all the pids in multiple lines to pid in 1...
Showing results 1 to 25 of 88

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