With this option, confirmation of removal of any file occurs interactively. It overrides the -f option and remains in effect even if the standard input is not a terminal. This option allows users to remove the directory dirname and its parent directories which become empty. A message is printed on standard output about whether the whole path is removed or part of the path remains for some reason. This option is used to suppress the message printed on standard error when -p is in effect.
All messages are generally self-explanatory.
Both rm and rmdir return exit codes of 0 if all the specified directories are removed successfully. Otherwise, they return a non-zero exit code. This migration aid may disappear in a future release.