![]() 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. sudo rm -rf -> rm means "remove," as in "delete." -rf means "recursive and force." "Recursive" means "delete all of the contents, too" and is needed for deleting folders.Presumably runs Logitech's uninstall procedure. sudo /./lghub_updater -uninstall -> Give the uninstall command to the program called lghub_updater.That means "replace this part with the variable user" You'll notice $user in one of the file paths later. ![]() ![]() user="put your username here" -> That sets a variable called user to use later.I didn't seem to need it, though, so I didn't run it. I think it has something to do with how the script will handle errors (OP halp). set -euo pipefail -> EDIT: OP explains below! I don't actually know what this does, lol.#!/bin/bash -> This instruction just says "I'm a shell script, run me with bash please".It's healthy to be skeptical about running code you found randomly on the internet, if you don't know what it does! So here's a brief overview: The sudo command means " do as a su -per user", and you need to provide your password to do anything as a super user. Don't forget to change user="put your username here" to your own username (with the quotes) or user=$(whoami) ( EDIT: Thanks OP) (without the quotes) Just copy, paste, hit enter, and do the next line. Open the Terminal app (every Mac has it) and paste the commands in line-by-line (or all at once, but IMO line-by-line is safer).make a file called gtfo-ghub.sh on your desktop) and change the "put your username here" part to match your username (with the quotes), or just make the line read user=$(whoami) ( EDIT: Thanks OP) (without the quotes). Copy-paste the whole script into a file with an.To run these commands, you can do one of two things: Just to add a little more detail to people who aren't familiar with the command line: Running the commands You posted this literally 3 minutes before I needed it, lol.
0 Comments
Leave a Reply. |