79124848

Date: 2024-10-25 08:28:47
Score: 1
Natty:
Report link
if ! which command > /dev/null; then
   echo -e "Command not found! Install? (y/n) \c"
   read -r REPLY
   if [ "$REPLY" = "y" ]; then
      sudo apt-get install command
   fi
fi

-r is used for to avoid interpreting backslashes

Updated the proper condition's with [ ]

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Swapnil Saindane