-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnu-utils.sh
More file actions
executable file
·34 lines (25 loc) · 831 Bytes
/
gnu-utils.sh
File metadata and controls
executable file
·34 lines (25 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# Install Updated GNU Utilities
# Exit immediately if a command exits with a non-zero status
set -e
# Update the user's cached credentials, authenticating the user if necessary
sudo -v
# Store a local variable of the scripts current directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if ! command -v "brew" > /dev/null 2>&1; then
echo "==> Homebrew not found. Installing now..."
${DIR}/brew.sh
fi
if command -v "brew" > /dev/null 2>&1; then
echo "==> Installing updated GNU utilities..."
# Install current version of bash
brew install bash
# Install GNU versions of command line utils
brew install grep
brew install gnu-sed
brew install moreutils
echo "==> Updated GNU utilities installed."
else
echo "==> Homebrew not found. Aborting..."
exit 1
fi