From 787c1866e2bd7b2aec70b8f1bc9271f636850953 Mon Sep 17 00:00:00 2001 From: Ed Braaten Date: Sun, 17 May 2015 08:55:00 -0700 Subject: [PATCH] Added "what" script. Moved miscellaneous tools (sizeofchk, what) into their own "misc-tools" sub-directory and updated README.md to reflect the change. --- README.md | 5 +++-- {sizeofchk => misc-tools/sizeofchk}/Makefile | 0 {sizeofchk => misc-tools/sizeofchk}/README.md | 0 {sizeofchk => misc-tools/sizeofchk}/sizeofchk.c | 0 misc-tools/what | 12 ++++++++++++ 5 files changed, 15 insertions(+), 2 deletions(-) rename {sizeofchk => misc-tools/sizeofchk}/Makefile (100%) rename {sizeofchk => misc-tools/sizeofchk}/README.md (100%) rename {sizeofchk => misc-tools/sizeofchk}/sizeofchk.c (100%) create mode 100755 misc-tools/what diff --git a/README.md b/README.md index 4f92b6a..d257295 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # src-ed -Source code samples for various languages - hello name-your-language world! - +Source code samples for various languages - hello "name-your-language" world! +The subdirectory "misc-tools" contains miscellaneous utilities that may +be of interest or help to a programmer. diff --git a/sizeofchk/Makefile b/misc-tools/sizeofchk/Makefile similarity index 100% rename from sizeofchk/Makefile rename to misc-tools/sizeofchk/Makefile diff --git a/sizeofchk/README.md b/misc-tools/sizeofchk/README.md similarity index 100% rename from sizeofchk/README.md rename to misc-tools/sizeofchk/README.md diff --git a/sizeofchk/sizeofchk.c b/misc-tools/sizeofchk/sizeofchk.c similarity index 100% rename from sizeofchk/sizeofchk.c rename to misc-tools/sizeofchk/sizeofchk.c diff --git a/misc-tools/what b/misc-tools/what new file mode 100755 index 0000000..61d4528 --- /dev/null +++ b/misc-tools/what @@ -0,0 +1,12 @@ +#!/bin/bash +# +# what - get SCCS identification information +# +# SCCS was the source code control system distributed +# with AT&T Unix System III and V. +# +for i in "$@"; +do + echo "$i:" + strings "$i" | grep -e '@(#)' | sed 's/^.*[@][(][#][)]\(.*\)/ \1/' +done