Skip to main content

add a couple of ‘mv’ shortcuts

ID
a0d264c
date
2022-08-08 17:25:08+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
08004e5
message
add a couple of 'mv' shortcuts
changed files
2 files, 32 additions

Changed files

fun (0) → fun (369)

diff --git a/fun b/fun
new file mode 100755
index 0000000..1129fbb
--- /dev/null
+++ b/fun
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# This is a shortcut for 'mv' that I use for filing documents.
+#
+# I have a 'fun' directory that's divided into years where I put fun stuff;
+# running `fun nameofdocument.pdf` will move it to the appropriate folder
+# for the current year.
+
+set -o errexit
+set -o nounset
+
+YEAR="$(date +"%Y")"
+
+for f in "$@"
+do
+  mv "$f" ~/Documents/fun/"$YEAR"
+done

wellcome (0) → wellcome (389)

diff --git a/wellcome b/wellcome
new file mode 100755
index 0000000..c0a8c5e
--- /dev/null
+++ b/wellcome
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+# This is a shortcut for 'mv' that I use for filing documents.
+#
+# I have a 'wellcome' directory that's divided into years where I put
+# work documents; running `wellcome nameofdocument.pdf` will move it
+# to the appropriate folder for the current year.
+
+set -o errexit
+set -o nounset
+
+YEAR="$(date +"%Y")"
+
+for f in "$@"
+do
+  mv "$f" ~/Documents/wellcome/"$YEAR"
+done