Browse Source

Switch library script to bash, better read call

Samuel W. Flint 1 year ago
parent
commit
b79596a3e8
1 changed files with 8 additions and 15 deletions
  1. 8 15
      library

+ 8 - 15
library

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 # packaging, library.org
 # configuration, /home/swflint/Projects/library/library.org
 export LIBRARY_FILE=${LIBRARY_FILE:-~/.library/library.rec}
@@ -99,20 +99,13 @@ function run_query {
 # add-book, /home/swflint/Projects/library/library.org
 function add_single {
     if [[ $# -lt 7 ]] ; then
-        echo -n "Title: "
-        read TITLE
-        echo -n "Author: "
-        read AUTHOR
-        echo -n "LCCN: "
-        read LCCN
-        echo -n "Copyright: "
-        read COPYRIGHT
-        echo -n "Publisher: "
-        read PUBLISHER
-        echo -n "ISBN: "
-        read ISBN
-        echo -n "Location: "
-        read LOCATION
+        read -e -p "Title: " TITLE
+        read -e -p "Author: " AUTHOR
+        read -e -p "LCCN: " LCCN
+        read -e -p "Copyright Year: " COPYRIGHT
+        read -e -p "Publisher: " PUBLISHER
+        read -e -p "ISBN: " ISBN
+        read -e -p "Location: " LOCATION
     else
         TITLE=$1
         shift