On a script Im running I want it to exit if two commands have no output.
These are the commands;
#LOG ALL USERS IDLE FOR 1 HOUR PLUS;
finger -i | awk '/hour/ && $7 > 0 { print $1 ; }' > /dev/null 2>&1
#LOG ALL USERS IDLE FOR 45 MINUTES PLUS;
finger -i | awk '/minutes/ && $7 > 45 { print $1 ; }' > /dev/null 2>&1
If neither have any output then exit.
If either or both have outout then carry on.
Whats the best way of doing this?
Nogs
These are the commands;
#LOG ALL USERS IDLE FOR 1 HOUR PLUS;
finger -i | awk '/hour/ && $7 > 0 { print $1 ; }' > /dev/null 2>&1
#LOG ALL USERS IDLE FOR 45 MINUTES PLUS;
finger -i | awk '/minutes/ && $7 > 45 { print $1 ; }' > /dev/null 2>&1
If neither have any output then exit.
If either or both have outout then carry on.
Whats the best way of doing this?
Nogs