1

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

1 Answer 1

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
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .