![]() Set -o means to set an option, and in this case the supplied option is pipefail, which means "If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands in the pipeline exit successfully" from the bash docs. If you set a variable name="my name" but then try to use a variable $Name, it will treat this as an error and exit. Set -u means "Treat unset variables as an error when performing parameter expansion" from the bash docs. Since bash functions can only return integers, any function that returns an integer other than 0 is greated as a failure and the whole script exits with an exit code of 1. Set -e means "Exit immediately if a simple command exits with a non-zero status" from the bash docs. Set -euo pipefail can be expressed in parts: Thanks for explaining the whole thing, though I have one correction: user=whoami will just make your user the string "whoami" - you want this to be user=$(whoami). What's set -euo pipefail for, btw? EDIT: Thanks OP :) All of the directories were already deleted by the uninstaller except for /Users/Shared/.logishrd. My experienceįor me, I ran the commands manually, line by line. So in summary: This script will take down your username, run Logitech's uninstaller, and then delete four folders. ![]() "Force" means "don't ask me for permission every time you're not sure, just do it." (You can omit the f so it's just rm -r, and it'll be a little safer, but might bother you for permission a few times.
0 Comments
Leave a Reply. |