I want to run a check platform & application script under ksh (Soaris boxes).
It runs some commands and it take some time.
I want to customize it like that:
output is too big, hence I want some output of the commands to be redirect
ed in an output file (or maybe two or three) - not all just a part of them
& commands alternate by execution order
I want to run it in bg only when I want to allow some
other jobs meanwhile - customize it by params.when it is launched?
It works to group some part using "{" and "}" and redirect the output OK but in fact I want both - the output to be displayed and meanwhile to be redirected in some result file running the same command only once.
For some commands I want both for some other not.
Also I want that my script to analyse an output already generated previously - more specific:
After I run a "df -k" command I want that my output of "df -k" to be analysed later in the same script.
I'm interested only in those partitions that starts with "/dev/" or that have a specific name (excluding swap & similar) and if the percentage of the occupied space is greater than some critical value the script must display a NOK and in addition that line from "df -k" again as a warning - otherwise OK.
to have output displayed as well as redirected to a file.
If you want to use the out of a command later on the script you either have to store the result in variables or send it to a file and read back this file later on.
The have the result of only specific filesystems is a matter of piping the output of df -k to grep with the right regular expression