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)"
#! /bin/sh
OUTPUT="$(df | egrep "([89][0-9]|100)%")"
Echo "$(OUTPUT)"
ASKER
This is not working. The output is blank where as the command ran by itself gives the filesystems over the percentage
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No its only echoing the command not the output
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Still not working. I just need this command to echo an output
df | egrep "([89][0-9]|100)%"
df | egrep "([89][0-9]|100)%"
please run below command then post output:
df | egrep "[89][0-9]|100%"
df | egrep "[89][0-9]|100%"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
(258)==> df | egrep "([89][0-9]|100)%"
/dev/vg00/sysadmlv 2097152 1669080 401479 81% /sysadm
wins04:root:[/]
(259)==>
/dev/vg00/sysadmlv 2097152 1669080 401479 81% /sysadm
wins04:root:[/]
(259)==>
ASKER
When I try the echo$(command) I still do not get output
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Still no output. Im thinking I may have to take a different route or something
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is hpux 11.1 so no -k function.
df |egrep '\%' Gives full df output when ran normally
df |egrep '\%' Gives full df output when ran normally
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It was the case sensitive issue thank you
You're welcome ;)
echo ${output}