#!/bin/bash upd() { checkupdates | wc -l > /tmp/checkupdates } if [[ ! -f /tmp/checkupdates ]]; then upd fi count=$(cat /tmp/checkupdates) status="$count updates" if [[ $count -eq 0 ]]; then status="Up to date" elif [[ $count == "1" ]]; then status="$count update" fi echo "$status" upd & disown