pipe output to /dev/null and use variables in command