Sponsored Content
Full Discussion: IF question
Top Forums Shell Programming and Scripting IF question Post 302439921 by Mettemusens on Sunday 25th of July 2010 04:59:44 AM
Old 07-25-2010
IF question

Hi there

I'm new to bash and unix for that matters. Just started yesterday, having to do a script for work, outputting HTML from various system info's. And me having coded Rexx for years ... then this is a little different :-)

My question is simple .... I have an IF that does not work - > It seems to run the commmand instead.

I need to set a variable after a given percentage ...

Can you give me a hint.

regards
Mette

---------------------------------------------

Code:
while read inputline
do
   
   filsyst="$(echo $inputline | awk '{print $2}')"
       pct="$(echo $inputline | awk '{print $6}')"
   
   if ["$pct" >= $DiskCritical]; then
      BGC='FF0000'
   else 
      if ["$pct" >= $DiskWarning]; then
         BGC='EEDD11' 
      else
         BGC='009900'
      fi
   fi
   
   ... bla bla HTML stuff    
done < $limit

This is the content of the file:
Code:
/ /dev/mapper/VolGroup00-LogVol00 38471112 9755264 26730108 27%
/boot /dev/hda1 101086 12043 83824 13%
/dev/shm tmpfs 546000 286688 259312 53%
/media/VBOXADDITIONS_3.2.4_62467 /dev/hdc 32686 32686 0 100%


Last edited by Mettemusens; 07-25-2010 at 06:45 AM.. Reason: Please use code tags
 

7 More Discussions You Might Find Interesting

1. Programming

Yet Another Question

Now that I have getch() to work, I have yet another problem. BTW, thank you for answering these questions, I do ask a lot, only because I am eager to know, what is a board used for anyways :) Ok, he's the problem... #include iostream.h #include conio.h int main() { char movement; ... (2 Replies)
Discussion started by: mbolthouse
2 Replies

2. Solaris

vi question

Im trying to edit a 113 meg file in VI and i get the error TMP FILE TOO LARGE. Does someone know how to get around this? Thanks! (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

3. UNIX for Dummies Questions & Answers

mv question

Hello if I like to move file from defined directories system to new directory that not contained any directories system structure . But I like to create the same file system structure as source directory for example : I have 2 directories: foo1 and foo2 foo1 have directories and foo2 have... (2 Replies)
Discussion started by: umen
2 Replies

4. UNIX for Dummies Questions & Answers

Question

hallo, ik heb hier een vraagje. hoeveel gebruikers kunnen er op 1 unix systeem. hopelijk antwoorden golle nu want ik moet da vinde voor school en die leerkracht zaagt. :p groetjes eu wacht wa was mijne nick ah ja vraagje groetjes vraagje ik kan geen engels dus antwoord liever in het... (1 Reply)
Discussion started by: vraagje
1 Replies

5. Shell Programming and Scripting

question about wc

Hey my friend was asking me if i knew a way to cout how many different words in a file. I told him no not off hand, but i was thinking about it, and i started to wonder also. I imagine this is probably pretty simple im just missing something, I keep confusing my self with how you would compair and... (16 Replies)
Discussion started by: yodadbl07
16 Replies

6. Hardware

question

How to add 3 moniters to a pc set up? (2 Replies)
Discussion started by: clicstic
2 Replies

7. AIX

df question

Hi, Can anyone please explain a little about df command. I have following question: Following example is showing % used as 4 where as total free blocks are 15.46 out of 16.00 MB blocks. df -m /test Filesystem MBblocks Free %Used Iused %Iused ... (5 Replies)
Discussion started by: itsabhi9
5 Replies
IMAGECOPYMERGE(3)							 1							 IMAGECOPYMERGE(3)

imagecopymerge - Copy and merge part of an image

SYNOPSIS
bool imagecopymerge (resource $dst_im, resource $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h, int $pct) DESCRIPTION
Copy a part of $src_im onto $dst_im starting at the x,y coordinates $src_x, $src_y with a width of $src_w and a height of $src_h. The portion defined will be copied onto the x,y coordinates, $dst_x and $dst_y. PARAMETERS
o $dst_im -Destination image link resource. o $src_im -Source image link resource. o $dst_x - x-coordinate of destination point. o $dst_y - y-coordinate of destination point. o $src_x - x-coordinate of source point. o $src_y - y-coordinate of source point. o $src_w -Source width. o $src_h -Source height. o $pct - The two images will be merged according to $pct which can range from 0 to 100. When $pct = 0, no action is taken, when 100 this function behaves identically to imagecopy(3) for pallete images, except for ignoring alpha components, while it implements alpha transparency for true colour images. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Merging two copies of the PHP.net logo with 75% transparency <?php // Create image instances $dest = imagecreatefromgif('php.gif'); $src = imagecreatefromgif('php.gif'); // Copy and merge imagecopymerge($dest, $src, 10, 10, 0, 0, 100, 47, 75); // Output and free from memory header('Content-Type: image/gif'); imagegif($dest); imagedestroy($dest); imagedestroy($src); ?> PHP Documentation Group IMAGECOPYMERGE(3)
All times are GMT -4. The time now is 06:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy