add example scripts - iomenu - interactive terminal-based selection menu
(HTM) git clone git://bitreich.org/iomenu git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/iomenu
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 7e90ef5eb5bebae51da05ea9f5fd0bb8eafaa98d
(DIR) parent 3905e591078c229e7db64662c9f933bc1c7a504d
(HTM) Author: Josuah Demangeon <mail@josuah.net>
Date: Sun, 17 Jun 2018 19:06:12 +0200
add example scripts
Diffstat:
M Makefile | 8 ++++----
A bin/io-find | 6 ++++++
A bin/io-fstab | 9 +++++++++
A bin/io-man | 7 +++++++
A bin/io-mblaze | 20 ++++++++++++++++++++
A bin/io-net | 4 ++++
A bin/io-passwd | 9 +++++++++
A bin/io-ps | 9 +++++++++
8 files changed, 68 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
@@ -29,7 +29,7 @@ clean:
.PHONY: install
install: iomenu
- mkdir -p ${PREFIX}/share/man/man1
- cp *.1 ${PREFIX}/share/man/man1
- mkdir -p ${PREFIX}/bin
- cp iomenu ${PREFIX}/bin
+ mkdir -p ${PREFIX}/share/man/man1
+ cp *.1 ${PREFIX}/share/man/man1
+ mkdir -p ${PREFIX}/bin
+ cp iomenu bin/* ${PREFIX}/bin
(DIR) diff --git a/bin/io-find b/bin/io-find
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+# find a file from current directory with iomenu
+
+test $# = 0 && set -- .
+
+find "$@" '(' -name .git -o -name CVS ')' -prune -o -print | sort | iomenu
(DIR) diff --git a/bin/io-fstab b/bin/io-fstab
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+# display mounts and fstab in iomenu
+
+{
+ printf '#/etc/fstab\n'
+ column -ts ' ' </etc/fstab
+ printf '#mount\n'
+ mount | column -ts ' '
+} | iomenu -#
(DIR) diff --git a/bin/io-man b/bin/io-man
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+# man page picker with iomenu
+
+man -k ' ' | sed -r '
+ s/ - / - /
+ s/(.{25}[^ ]* ) * - /\1- /
+' | iomenu | sed -r 's,[(,].*,,' | xargs man
(DIR) diff --git a/bin/io-mblaze b/bin/io-mblaze
@@ -0,0 +1,20 @@
+#!/bin/sh -e
+# mail client using iomenu, mblaze, to be used with mfilter
+
+cd /home/mail
+
+if test "$1" = -a
+then IFS=' ' read dir mail <<EOF
+$(iomenu -'#' <index)
+EOF
+ mseq -S <$dir/seq >/dev/null
+ exec mless "$(echo $mail | sed -r 's, *([0-9]+).*,\1,')
+fi
+
+wc -l */seq | sed 's, 0, .,; s,/seq$,,' |
+ iomenu | sed -r 's,^ +[^ ]+ +,,' |
+ xargs printf %s/%s "$(pwd)" | mlist | msort -r -d | mseq -S
+
+mscan -f '%6n %u %D %20f %t%2i%120S' |
+ iomenu | sed -r 's,^ *([0-9]*) .*,\1,' |
+ xargs mless
(DIR) diff --git a/bin/io-net b/bin/io-net
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+# searchable netstat results with iomenu
+
+netstat "$@" | sed 's/^[AP]/#&/' | iomenu -'#'
(DIR) diff --git a/bin/io-passwd b/bin/io-passwd
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+# display /etc/passwd and /etc/group in iomenu
+
+{
+ printf '#/etc/passwd\n'
+ column -ts : < /etc/passwd
+ printf '#/etc/group\n'
+ column -ts : < /etc/group
+} | iomenu -'#'
(DIR) diff --git a/bin/io-ps b/bin/io-ps
@@ -0,0 +1,9 @@
+#!/bin/sh -e
+# process list picker with iomenu
+
+ps='ps -o pid,user,stat,args'
+
+{
+ printf '#'
+ ps "$@"
+} | iomenu -'#' | sed -r 's/[^ ]* *([0-9]*).*/\1/'