0

I want to output "hello" when rpm -qf /etc/redhat-release is typed. Otherwise rpm should work as it would normally.

7

Doesn't seem overly useful, but a function would do the trick:

rpm() {
  if [ "$1" = "-qf" ] && [ "$2" = "/etc/redhat-release" ]
  then
    echo hello
  else
    command rpm "$@"
  fi
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.