sudo su
asks for a password on my system. Did you run another sudo
command before the sudo su
? Once you've run sudo
and entered your password, it doesn't require a password again for a period of time.
Modify the file .bash_profile with nano or another appropriate editor:
Replace:
export PATH=’/usr/local/bin:??
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
by:
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
export PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH
Explanation:
The first line of your current .bash_profile
export PATH=’/usr/local/bin:??
modifies the standard value of $PATH given by /etc/paths from
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
to ’/usr/local/bin:??
- which is no valid path.
The fourth and fifth line of your current .bash_profile modifies $PATH to
/Library/Frameworks/Python.framework/Versions/2.7/bin:’/usr/local/bin:??
Since ’/usr/local/bin:?
is no valid path the finally effective PATH is
/Library/Frameworks/Python.framework/Versions/2.7/bin
which completely breaks your standard PATH. You can still execute all executables in the above directories but you can't omit the superior directories (e.g. to execute nano you have to enter /usr/bin/nano
instead of nano
).
Best Answer
.command scripts run in Terminal windows (that is, when you double-click a .command file, it opens a Terminal window, and you can use that window to interact with the script). You can use that to prompt the user and get input; exactly how you do that depends on the scripting language you're using (which is determined by the shebang (starts with
#!
) line at the beginning of the script. In bash, you'd do something like:In zsh, the syntax for adding a prompt to the
read
command is different, and it has a-q
option specifically for y/n questions (that succeeds if the answer is "y" or "Y", and can be used directly in anif
):In other languages, you'd do... whatever you do in that language to prompt for and accept input.