Instead of repeatedly doing "ls ... > /dev/null 2>&1", just use a function that does exactly that.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>