log finds ship

This commit is contained in:
James Tomasino 2018-11-20 23:14:19 -05:00
parent d1f8110e2d
commit 93e00af865
1 changed files with 13 additions and 3 deletions

16
log
View File

@ -1,4 +1,14 @@
#!/usr/bin/env bash
#!/bin/sh
ships=$(find /var/gopher -user "$(whoami)" -type d -print)
echo -e "$ships"
user=$(whoami)
ships=$(find /var/gopher -user "$user" -type d -exec basename {} \;)
numships=$(echo "${ships}" | wc -l)
printf "Initializing QEC...\\n\\n"
printf "Ready to transmit for %s\\n" "${user}"
if [ "$numships" -eq 0 ]; then
printf "No ships found in system.\\n"
elif [ "$numships" -eq 1 ]; then
printf "Ship found: %s\\n" "${ships}"
else
printf "Multiple ships found: %s\\n" "${ships}"
fi