From d0204ba25666f3d2368c6fe453dd465a1fd189f3 Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sat, 15 Sep 2018 02:40:20 -0700 Subject: [PATCH] Fixed option parsing with dashes, renamed two scripts --- dlaudio.sh | 2 +- getweather.sh | 2 +- lsgroups => lsgroups.sh | 0 lsusers | 4 ---- lsusers.sh | 4 ++++ 5 files changed, 6 insertions(+), 6 deletions(-) rename lsgroups => lsgroups.sh (100%) delete mode 100755 lsusers create mode 100755 lsusers.sh diff --git a/dlaudio.sh b/dlaudio.sh index 0c883e8..653975b 100755 --- a/dlaudio.sh +++ b/dlaudio.sh @@ -147,7 +147,7 @@ while true; do shift break ;; - -?*) + -*) echo "Error, not an option: ${1}" >&2 exit 1 ;; diff --git a/getweather.sh b/getweather.sh index a499c57..f2c03d0 100755 --- a/getweather.sh +++ b/getweather.sh @@ -22,7 +22,7 @@ while true; do shift break ;; - -?*) + -*) echo "Not an option: ${1}" >&2 && exit 1 exit ;; diff --git a/lsgroups b/lsgroups.sh similarity index 100% rename from lsgroups rename to lsgroups.sh diff --git a/lsusers b/lsusers deleted file mode 100755 index 5a712bc..0000000 --- a/lsusers +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -# List all users on the system - -sort -u <(awk -F ':' '{print $1}' < /etc/passwd) diff --git a/lsusers.sh b/lsusers.sh new file mode 100755 index 0000000..6d752bb --- /dev/null +++ b/lsusers.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# List all users on the system + +sort --unique <(awk -F ':' '{print $1}' < /etc/passwd)