hello everyone,

i have a script in which i enter a log file into an array and then i go line by line to search for a line containing "free disk space". once the line is found i want to check if the value is greater than 75.
the line looks like this:
free disk space = 79
the problem is i don't know how to get the value of 'free disk space'
i know how to do it in bash:
FDC=`$line | grep 'free disk space' | awk '{print $5}'`
if FDC > 75 blah blah blah

any idea how to do it in perl?
thanks all

Recommended Answers

All 3 Replies

Is there more than one line with "free disk space" in the file?

Same thing `command` works in perl as well .

Is there more than one line with "free disk space" in the file?

yes, there are several hundreds...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.