about summary refs log tree commit diff
path: root/makeDir.sh
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2021-10-11 15:05:32 -0400
committerZach DeCook <zachdecook@librem.one>2021-10-11 15:05:32 -0400
commitb5f1684628e292d44ca00921900402258422b227 (patch)
treeea1532e0f68ed3ae2406562ae4e03359e0f7cc26 /makeDir.sh
parent7c22f7a4006e2cf154a301529aa8b93fce42f735 (diff)
downloadswipeGuess-b5f1684628e292d44ca00921900402258422b227.tar.gz
make method to split file into multiple files based on first and last letters
Diffstat (limited to 'makeDir.sh')
-rwxr-xr-xmakeDir.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/makeDir.sh b/makeDir.sh
new file mode 100755
index 0000000..aa9f782
--- /dev/null
+++ b/makeDir.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+dir="$1"
+rm $dir/*
+source functions.sh
+while read -r line; do
+	fl=$(firstLetter "$line")
+	ll=$(lastLetter "$line")
+	echo "$line" >> "$dir/$fl$ll"
+done