Link to home
Start Free TrialLog in
Avatar of Frog_1337
Frog_1337

asked on

UNiX Script filesystem space usage

I am working on a simple script and I cannot get the command to execute. I am certain I am missing a quote somewhere but cannot get the command to run. The script I have is below. The command by itself executes. When attempting to run in a script it will not

#! /bin/sh

OUTPUT="$(df | egrep "([89][0-9]|100)%")"
Echo "$(OUTPUT)"
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

output=$(df | egrep "([89][0-9]|100)%")
echo ${output}
Avatar of Frog_1337
Frog_1337

ASKER

This is not working. The output is blank where as the command ran by itself gives the filesystems over the percentage
SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No its only echoing the command not the output
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still not working. I just need this command to echo an output

df | egrep "([89][0-9]|100)%"
please run below command then post output:

df | egrep "[89][0-9]|100%"
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(258)==> df | egrep "([89][0-9]|100)%"
/dev/vg00/sysadmlv 2097152 1669080  401479   81% /sysadm
wins04:root:[/]
(259)==>
When I try the echo$(command) I still do not get output
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still no output. Im thinking I may have to take a different route or something
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is hpux 11.1 so no -k function.
df |egrep '\%' Gives full df output when ran normally
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It was the case sensitive issue thank you
You're welcome ;)