Skip to content

Instantly share code, notes, and snippets.

@josenicomaia
Created April 7, 2017 21:23
Show Gist options
  • Select an option

  • Save josenicomaia/c5c22b2640c1ea9f84272f17fed96c31 to your computer and use it in GitHub Desktop.

Select an option

Save josenicomaia/c5c22b2640c1ea9f84272f17fed96c31 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Get password to be used with sudo commands
# Script still requires password entry during rvm and heroku installs
echo -n "Enter password to be used for sudo commands:"
read -s password
# Function to issue sudo command with password
function sudo-pw {
echo $password | sudo -S $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment