Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Search Forums

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Showing results 1 to 8 of 8
Search took 0.01 seconds.
Search: Posts Made By: ghostdog74
Forum: Programming/Scripts 20th September 2008, 14:42
Replies: 1
Views: 3,845
Posted By ghostdog74
you can convert the str into int before the...

you can convert the str into int before the addition using int()
Forum: Programming/Scripts 7th April 2008, 05:59
Replies: 9
Views: 33,037
Posted By ghostdog74
bash don't do floats. and why do you want to do...

bash don't do floats. and why do you want to do double checking of threshold when you have already done it in awk?


uptime | awk -v max="0.05" '$NF>max{
print "Threshold reached"
# do...
Forum: Programming/Scripts 6th April 2008, 16:59
Replies: 9
Views: 33,037
Posted By ghostdog74
assign a variable to it, just like you did ...

assign a variable to it, just like you did

variable=$(uptime | awk -v max="2" '$NF>max{ print $NF}')
Forum: Programming/Scripts 6th April 2008, 08:19
Replies: 9
Views: 33,037
Posted By ghostdog74
uptime | awk -v max="2" '$NF>max{ print...

uptime | awk -v max="2" '$NF>max{
print "Threshold reached"
}'
Forum: Programming/Scripts 2nd November 2007, 15:33
Replies: 1
Views: 7,820
Posted By ghostdog74
with awk awk '!/AREA/{print}' "file" >...

with awk


awk '!/AREA/{print}' "file" > newfile
mv newfile file


with sed

sed -i '/AREA/d' file
Forum: Programming/Scripts 1st September 2007, 11:25
Replies: 2
Views: 14,360
Posted By ghostdog74
you escape the slashes... sed -e...

you escape the slashes...

sed -e "s/images/http:\/\/cache.somewebsite.com\/images/" file
Forum: Programming/Scripts 27th April 2007, 04:16
Replies: 2
Views: 3,748
Posted By ghostdog74
you can use awk awk -v file="Prac1" '...

you can use awk



awk -v file="Prac1" ' BEGIN { # get all sids of Prac1 into array
while( (getline line < file )>0 ) {
if (line ~ /^#/ ) continue #skip comments
mprac[line]
}
...
Forum: Programming/Scripts 24th April 2007, 16:48
Replies: 1
Views: 5,028
Posted By ghostdog74
you are using perl, and then you are using other...

you are using perl, and then you are using other OS tools like more and cut. this is overkill. in perl , you can split your string eg perldoc -f split, you can see how its done. if you want to use...
Showing results 1 to 8 of 8

 
Forum Jump

All times are GMT +2. The time now is 10:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.