![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Array inside an array | manas_ranjan | UNIX for Advanced & Expert Users | 5 | 06-10-2008 03:25 PM |
| create array holding characters from sring then echo array. | rorey_breaker | Shell Programming and Scripting | 5 | 09-28-2007 09:42 AM |
| How big is my awk array? | pondlife | Shell Programming and Scripting | 4 | 09-10-2007 01:40 PM |
| using array | RianTan | Shell Programming and Scripting | 3 | 09-05-2005 04:47 AM |
| Do I need an array here? | TheCrunge | Shell Programming and Scripting | 5 | 04-19-2005 04:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I want to write a line to a log file for each mountpoint that is above 75% disk space used.
I have written the following so far which doesn't take into account the checking for 75% yet but simply tries to write a line for every mountpoint into the logfile. #!/bin/ksh PERCENTAGES=`bdf | grep /var/opt/ixos/ | awk '{ print $4 }'` MOUNTPOINTS=`bdf | grep /var/opt/ixos/ | awk '{ print $5 }'` len=${#PERCENTAGES[*]} echo "len=$len" i=0 while [ $i -lt $len ] do echo "${MOUNTPOINTS[$i]} IS ${PERCENTAGES[$i]} FULL RIGHT NOW" (( i=i+1 )) done exit 0 PERCENTAGES and MOUNTPOINTS seems to get populated properly but for some reason no matter what I try the len assignment line always wants to be 0. Even when I hardcoded len=10 (which is the number of elements both arrays are actually assigned) the loop doesn't work as desired and instead seems to print out the contents of each whole array each time they're referenced in the loop. Any help would be appreciated as I believe it's pretty close but I'm obviously missing something. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|