Sponsored Content
Full Discussion: please help me in FreeBSD
Operating Systems BSD please help me in FreeBSD Post 100369 by dsbeerf on Monday 27th of February 2006 04:40:41 AM
Old 02-27-2006
Quote:
Originally Posted by tadakamalla
Iam working on Free BSD 5.3 version.
Now i want to check which partition if greater than 90% full without scanning the first row of record. How to do this ? Please anyone of u help me with this?
This is quick, done early in the morning, but it works. Please don't yell at my 'inefficiencies" ! :>D Streamline it as you will.
It more than likely NEEDS it BADLY.
===========

#!/bin/ksh

get_size () {

IFS="%
"
df -k | grep '\/dev\/' | awk '{ printf "%s\t%d\n",$6,$5 }'

IFS="
"

}

alm_func () {
LIM=$1
shift
NUM=`echo $#/2 | bc`
while [ $NUM -gt 0 ]
do
if [ $2 -gt $LIM ]; then
echo "Partition $1 is at $2'%'."
fi
shift;
shift;
((NUM=NUM-1))
done
}

#=======

if [ $# -ne 1 ]; then
echo "$0: Invalid number of arguments"
echo "usage: $0 <filesystem utilization limit>"
exit 1
fi

LIMIT=$1

alm_func $LIMIT `get_size`

======
IFS is usually "<space><tab><\n>" I add the '%'
as a lazy way to make it a field delimiter and 'subtract' it from the 'df -k' output. Dirty, I know. :>D

==
If you want the DEVICE name, substitute '$1' for the '$6' in the AWK statement in "get_size()"

====
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need help with FreeBSD!!!

Hi I want to write to my output_file using: if((fptr = creat(output_file, _S_IWRITE)) == -1) { printf("output_file..."..); return (1); } for(...) { _write(fptr, buffer, BUF_SIZE); } It says "_S_IWRITE" undeclared!!! Anybody knows what function I can use for that and what I... (3 Replies)
Discussion started by: lacasa
3 Replies

2. UNIX for Dummies Questions & Answers

FreeBSD

I am on AOL now,and i am using 56 k,i was gonna install FreeBSD,but i dont know if aol works on BSD,or my modem. Do they work on BSD? (2 Replies)
Discussion started by: kita
2 Replies

3. UNIX for Dummies Questions & Answers

Freebsd 4.5

i am new at unix and am VERY confused about the compression processes. what progs do i need to unzip and zip files? there must be a standard one similar to winzip? (1 Reply)
Discussion started by: Mindscan
1 Replies

4. UNIX for Dummies Questions & Answers

FreeBSD

What is FreeBSD, who does use Free? (3 Replies)
Discussion started by: cyberangel
3 Replies

5. BSD

FreeBSD 5.2.1

I want someone tell me the positives and negatives points of FreeBSD 5.2.1, if someone help me, i thanks a lot! (4 Replies)
Discussion started by: israel
4 Replies

6. BSD

I want the Best FREEBSD

B]I want the best of the best FreeBSD version for my study in Unix...please sugest me... Thanks (5 Replies)
Discussion started by: israel
5 Replies

7. BSD

Having problem with FreeBSD 5.3

I just download the FreeBSD 5.3 i386 iso files. And I have a problem now, I can't copy the 5.3-RELEASE-i386-disc2.iso to the cd, I try a lot of times, even change lots of blank cd to try but still cannot. But I can copy the other three iso files, i.e. 5.3-RELEASE-i386-bootonly.iso,... (4 Replies)
Discussion started by: GarbageKing
4 Replies

8. Programming

Application crashes in FreeBSD 7.1 while working ok in FreeBSD 6.3

Hello there, My mulithreaded application (which is too large to represent the source code here) is crashing after installing FreeBSD 7.1-RELEASE/amd64. It worked properly on others machines (Dual Cores with 4GB of RAM - FreeBSD 6.2-RELEASE/i386). The current machine has 2x Core 2 Duo... (1 Reply)
Discussion started by: Seenquev
1 Replies

9. Fedora

FreeBSD

I'm using Windows mostly and the only *nix thing I used during my life was cygwin (I like command line :)). But currently I have (by an occasion) a DVD with latest FreeBSD. I don't know why, but I want to install it... But probably, this OS is too difficult for a beginner. I heard, it's used on... (3 Replies)
Discussion started by: TeenageWerewolf
3 Replies
sudoku_generator(1)						   User Commands					       sudoku_generator(1)

NAME
sudoku_generator - generate and solve Sudoku puzzles SYNOPSIS
sudoku_generator [-n|--non-sym] [-d|--dump] [givens_count] sudoku_generator -s|--solve|-p|--print sudoku_dump DESCRIPTION
sudoku_generator generates, solves and prints Number Place puzzles, so called Sudokus. A Sudoku puzzle consists of 9 x 9 cells subdivided into 9 regions with 3 x 3 cells. The rules are simple. There have to be the numbers from 1 to 9 in every row, column and region. givens_count Number of givens (<= 81). Default is 36. Generation of Sudoku puzzles with less than 26 givens takes very long. sudoku_dump String with 81 * 1-9 or _ (+ ignored). OPTIONS
-n, --non-sym Generate a non-symmetric Sudoku puzzle. Default is symmetric. -d, --dump Dump the generated Sudoku puzzle (don't print). -s, --solve sudoku_dump Solve a Sudoku puzzle. -p, --print sudoku_dump Print a Sudoku puzzle. -v, --version Print version information and exit. -h, --help Print help message and exit. COPYRIGHT
Copyright (C) 2005-2010, Thomas Gunther <tom@toms-cafe.de> This GPL program comes with ABSOLUTELY NO WARRANTY; this is free software, and you are welcome to redistribute it under certain conditions; see the source for details. sudoku_generator 0.3.5 April 2010 sudoku_generator(1)
All times are GMT -4. The time now is 10:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy