Sponsored Content
Top Forums Shell Programming and Scripting Need help on Linux script to monitor hard drive space Post 302394191 by wgreg23 on Wednesday 10th of February 2010 05:45:55 PM
Old 02-10-2010
Quote:
Originally Posted by wbathurs
You can try forcing the issue this way:

Code:
# First declare usep as an integer
typeset -i usep 
usep=$(echo $output | awk ' { print $1 }' | cut -d'%' -f1 )

That seems to have worked. Thanks.

Just out of curiosity, do you have any idea why it didn't work as originally scripted? It seems to me that it should have evaluated out to an integer so I'm not understanding what went wrong.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Format Hard Drive in Linux

What Command do I need to use to Format my hard Drive in Linux. Please help me out. -Regards -Iftikhar:) (2 Replies)
Discussion started by: syedifti
2 Replies

2. UNIX for Dummies Questions & Answers

Re-allocating hard drive space

Hi, Is their an easy way to realloate hard drive space on Solaris 10. For example : /c20td0 10G /space 90 G I would like to move some of the hard-drive space from "/space" and add it to "/c20td0". In Windows this can be easily done using Partition magic, anything similar for UNIX? (4 Replies)
Discussion started by: annointed3
4 Replies

3. Filesystems, Disks and Memory

The best partitioning schem for a 250GB Sata hard drive & a 75GB SCSI hard drive

Hi I have 2 75GB SCSI hard drives and 2 250GB SATA hard drives which are using RAID Level 1 respectively. I wana have both FTP and Apache installed on them as services. I'm wondering what's the best partitioning schem? I wana use FC3 as my OS, so, I thought I can use the 75GB hard drive as the /... (0 Replies)
Discussion started by: sirbijan
0 Replies

4. UNIX for Dummies Questions & Answers

Hard Disk drive space gone missing...

Sorry if this is totally the wrong place to post this but I have a question or something rather thats bugging me. I got a new Dell Inspiron laptop the other day and I was expecting it to have 80G on it, well atleast 70 or so after installation of OS and such but after looking carefully yesterday, I... (8 Replies)
Discussion started by: Ecclesiastes
8 Replies

5. UNIX for Advanced & Expert Users

How to install Linux on an external 320 gigabyte hard drive

Hi all, I would to know if I can install Linux on an external 320 gigabyte hard drive..I have Windows XP on my internal hard drive which is 80 GB , but this installation on 320 external HDD is for testing purpose If it is possible to install Linux on the external drive, will it cause any... (5 Replies)
Discussion started by: bsandeep_80
5 Replies

6. UNIX for Dummies Questions & Answers

Reformat WD 500 GB hard drive for Linux machine

Linux Red Hat machine GNOME version 2.16.0 External hard drive is a Western Digital 500 GB My Book Essential. How can I reformat the external hard drive so that I can backup my Linux machine? Thanks (1 Reply)
Discussion started by: jm4smtddd
1 Replies

7. Fedora

Need to incrwase PHYSICAL VOLUME space on hard drive with free space on it

Hi, I run Fedora 17. I created a physical volume of 30GB on a disk with 60GB of space so there is 30GB of free space. On the physical volume, I created my volume group and logical volumes. I assigned all the space in the physical volume to my volume group. I need to add the 30GB of free space... (1 Reply)
Discussion started by: mojoman
1 Replies

8. UNIX for Dummies Questions & Answers

Copy everything from remote Linux to external hard drive in windows

Hi, I`m trying to copy an entire directory(with numerous files, folders and subfolders etc, a content size of 500gigs) from a linux machine running Red Hat Enterprise Linux 6 to an external hard drive on my windows. I downloaded and installed psftp on my windows and I can login using psftp... (9 Replies)
Discussion started by: newbie83
9 Replies

9. UNIX for Beginners Questions & Answers

Question about setting up a hard drive for a videoserver under Linux

Hi there, I'm currently preparing for an exam and came across a question that I don't really know how to answer. "You want to set up a hard drive for a videoserver under linux. - The videofiles will have a size of at least 10MB and a maximum of 8BG. - The hard drive has a disk space of... (1 Reply)
Discussion started by: Eggsy
1 Replies
FAIL(9) 						   BSD Kernel Developer's Manual						   FAIL(9)

NAME
KFAIL_POINT_CODE, KFAIL_POINT_RETURN, KFAIL_POINT_RETURN_VOID, KFAIL_POINT_ERROR, KFAIL_POINT_GOTO, fail_point, DEBUG_FP -- fail points SYNOPSIS
#include <sys/fail.h> KFAIL_POINT_CODE(parent, name, code); KFAIL_POINT_RETURN(parent, name); KFAIL_POINT_RETURN_VOID(parent, name); KFAIL_POINT_ERROR(parent, name, error_var); KFAIL_POINT_GOTO(parent, name, error_var, label); DESCRIPTION
Fail points are used to add code points where errors may be injected in a user controlled fashion. Fail points provide a convenient wrapper around user-provided error injection code, providing a sysctl(9) MIB, and a parser for that MIB that describes how the error injection code should fire. The base fail point macro is KFAIL_POINT_CODE() where parent is a sysctl tree (frequently DEBUG_FP for kernel fail points, but various sub- systems may wish to provide their own fail point trees), and name is the name of the MIB in that tree, and code is the error injection code. The code argument does not require braces, but it is considered good style to use braces for any multi-line code arguments. Inside the code argument, the evaluation of RETURN_VALUE is derived from the return() value set in the sysctl MIB. See SYSCTL VARIABLES below. The remaining KFAIL_POINT_*() macros are wrappers around common error injection paths: KFAIL_POINT_RETURN(parent, name) is the equivalent of KFAIL_POINT_CODE(..., return RETURN_VALUE) KFAIL_POINT_RETURN_VOID(parent, name) is the equivalent of KFAIL_POINT_CODE(..., return) KFAIL_POINT_ERROR(parent, name, error_var) is the equivalent of KFAIL_POINT_CODE(..., error_var = RETURN_VALUE) KFAIL_POINT_GOTO(parent, name, error_var, label) is the equivalent of KFAIL_POINT_CODE(..., { error_var = RETURN_VALUE; goto label;}) SYSCTL VARIABLES
The KFAIL_POINT_*() macros add sysctl MIBs where specified. Many base kernel MIBs can be found in the debug.fail_point tree (referenced in code by DEBUG_FP). The sysctl variable may be set using the following grammar: <fail_point> :: <term> ( "->" <term> )* <term> :: ( (<float> "%") | (<integer> "*" ) )* <type> [ "(" <integer> ")" ] <float> :: <integer> [ "." <integer> ] | "." <integer> <type> :: "off" | "return" | "sleep" | "panic" | "break" | "print" The <type> argument specifies which action to take: off Take no action (does not trigger fail point code) return Trigger fail point code with specified argument sleep Sleep the specified number of milliseconds panic Panic break Break into the debugger, or trap if there is no debugger support print Print that the fail point executed The <float>% and <integer>* modifiers prior to <type> control when <type> is executed. The <float>% form (e.g. "1.2%") can be used to spec- ify a probability that <type> will execute. The <integer>* form (e.g. "5*") can be used to specify the number of times <type> should be exe- cuted before this <term> is disabled. Only the last probability and the last count are used if multiple are specified, i.e. "1.2%2%" is the same as "2%". When both a probability and a count are specified, the probability is evaluated before the count, i.e. "2%5*" means "2% of the time, but only 5 times total". The operator -> can be used to express cascading terms. If you specify <term1>-><term2>, it means that if <term1> does not 'execute', <term2> is evaluated. For the purpose of this operator, the return() and print() operators are the only types that cascade. A return() term only cascades if the code executes, and a print() term only cascades when passed a non-zero argument. EXAMPLES
sysctl debug.fail_point.foobar="2.1%return(5)" 21/1000ths of the time, execute code with RETURN_VALUE set to 5. sysctl debug.fail_point.foobar="2%return(5)->5%return(22)" 2/100ths of the time, execute code with RETURN_VALUE set to 5. If that does not happen, 5% of the time execute code with RETURN_VALUE set to 22. sysctl debug.fail_point.foobar="5*return(5)->0.1%return(22)" For 5 times, return 5. After that, 1/1000th of the time, return 22. sysctl debug.fail_point.foobar="0.1%5*return(5)" Return 5 for 1 in 1000 executions, but only 5 times total. sysctl debug.fail_point.foobar="1%*sleep(50)" 1/100th of the time, sleep 50ms. CAVEATS
It is easy to shoot yourself in the foot by setting fail points too aggressively or setting too many in combination. For example, forcing malloc() to fail consistently is potentially harmful to uptime. The sleep() sysctl setting may not be appropriate in all situations. Currently, fail_point_eval() does not verify whether the context is appropriate for calling msleep(). AUTHORS
This manual page was written by Zach Loafman <zml@FreeBSD.org>. BSD
May 10, 2009 BSD
All times are GMT -4. The time now is 03:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy