From db536f42f30514112944892f209520a2ac5a65c2 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 29 Jun 2016 17:38:14 -0400 Subject: Create a directory for placing sample JSON menu generation scripts, and add one (incomplete yet) for listing the contents of the current directory (home dir ususally) --- JsonMenu_Scripts/ls.json.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 JsonMenu_Scripts/ls.json.sh (limited to 'JsonMenu_Scripts/ls.json.sh') diff --git a/JsonMenu_Scripts/ls.json.sh b/JsonMenu_Scripts/ls.json.sh new file mode 100755 index 00000000..9a6ab847 --- /dev/null +++ b/JsonMenu_Scripts/ls.json.sh @@ -0,0 +1,10 @@ +#!/bin/sh +cmd="ls $1" +OUT="" +for name in `${cmd}`; do + if [ "${OUT}" != "" ] ; then + OUT="${OUT}," + fi + OUT="${OUT} \"${name}\" : { \"type\" : \"item\", \"action\" : \"${name}\"}" +done +echo "{ ${OUT} }" -- cgit