我将如何在 shell 脚本中执行以下操作?
$ su my_user
Password: my_password
这是必需的,因为我需要homebrew
在 mac 上安装,它不允许我在 下安装它sudo
,但要求我具有管理员权限。
$ sudo /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
Password:
Don't run this as root!
以及为什么我不能以当前用户(不是管理员)的身份运行它 -
$ /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
This script requires the user to be an Administrator. If this
sucks for you then you can install Homebrew in your home directory or however
you please; please refer to our homepage. If you still want to use this script
set your user to be an Administrator in System Preferences or `su' to a
non-root user with Administrator privileges.
以管理员身份登录以运行脚本不是一个选项,我必须su
在脚本中。