$
whoami
MY_USERNAME
$
sudo chown -R $MY_USERNAME /usr/local/Cellar
Correct idea, incorrect usage. (But that's okay, this can be a little confusing)
Look at this example: (the echo command just prints output)
"whoami" is a command that prints (returns as an output) your current username, as in "who am I?"
"echo $whoami" literally means "print the value of a variable called whoami" — nothing happens, I didn't create the variable.
"echo $toutou", again, just prints the empty variable toutou
"$(command)" means "run this command and just put the output here", so "echo $(whoami)" means literally "print whatever output the "whoami" command will produce".
The last one is an example of how variables work. First I'm telling it to, literally, "take whatever output the "whoami" command will produce and store that as variable called X", and then the second command is "print the value of a variable X".
Your command "
sudo chown -R $MY_USERNAME /usr/local/Cellar" would, as you now know, change ownership of the directory (+ everything inside) /usr/local/Cellar to a user whose name is stored in a variable called MY_USERNAME.
The correct form:
Code:
sudo chown -R $(whoami) /usr/local/Cellar
will literally tell it to "change ownership of the directory (+ everything inside) /usr/local/Cellar to a user whose name gets printed by running the "whoami" command.
Which is exactly what you wanted to do.
But I believe this isn't necessary, the directory should already be owned by your admin user.
Now, this:
Code:
-bash: cd: /FILEPATH/minipro-master: Permission denied
does make sense. The minipro-master folder belongs to your normal user, right? Not to your admin user. The admin in OSX is not an actual root account ("root" in the Unix lingo), it's just a user that is
able to request root privileges via "sudo".
Login into your admin account. Try to cd into the folder, it won't let you. But we won't be needing the folder anymore, so let's just ruin it.
Code:
sudo chmod a+rwx /path/to/minipro-master
literally "give (+) everyone (a) permission to read/write/execute (rwx) in the folder.
This will prompt you for a password, and because you're logged in as your admin, enter your admin user password. This should work 100% if you can log in with the same password.
And then give the "sudo make install" a go. That one won't work without "sudo" at all.