0

I am writing an Script(BASH script), which uses dpkg, rpm, pacman commands, but at a time for a os one command is applicable, these command will run in different OS so for some os dpkg will pop up the error, is there any way to not let print the error while running this script ? am i clear ? ./test_package.sh: line 20: rpm: command not found i want to suppress this error.

Arun Gupta
  • 810
  • 2
  • 9
  • 26
  • You can redirect stderr to `dev/null` --> `2 > /dev/null`. – fedorqui Feb 21 '14 at 14:00
  • 2
    It's better to check if a command exists first. [Here's a related question][1] [1]: http://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script – sousa Feb 21 '14 at 14:04

0 Answers0