From 196c91bb3fb9a469a90f6ed9c0fbf408d14fe040 Mon Sep 17 00:00:00 2001
From: Steven Baltakatei Sandoval <baltakatei@gmail.com>
Date: Mon, 20 Feb 2023 18:40:49 +0000
Subject: [PATCH 1/1] feat(user/rmsym):Add script to delete only symlinks

---
 user/rmsym | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 user/rmsym

diff --git a/user/rmsym b/user/rmsym
new file mode 100644
index 0000000..87f3549
--- /dev/null
+++ b/user/rmsym
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+# Desc: Delete symlinks; skips non-symlinks
+# Usage: rmsym [paths]
+# Version: 0.0.1
+
+yell() { echo "$0: $*" >&2; } # print script path and all args to stderr
+die() { yell "$*"; exit 111; } # same as yell() but non-zero exit status
+must() { "$@" || die "cannot $*"; } # runs args as command, reports args if command fails
+main () {
+    # Check args
+    for psarg in "$@"; do
+        if [[ -h "$psarg" ]]; then
+            rm "$psarg";
+        else
+            yell "Not a symbolic link; not deleting:$psarg";
+            continue;
+        fi;
+    done;
+}; # main program
+
+main "$@";
+
+# Author: Steven Baltakatei Sandoval
+# License: GPLv3+
-- 
2.39.5