[comp.sys.hp] Here's a function key set up program

cnsy@vax5.CIT.CORNELL.EDU (01/19/89)

Function Key Setup Script
-------------------------

I thought I would pass this on.  It's a script I wrote to set up the function
keys (f1-f8) on my terminal.  It works on HP-UX systems, and is attached
below in a shar file (it has a number of control characters, hence the
packing).  I've found this function set up to be my most useful mix for
working in HP-UX.

When unpacked, (optionally: install in /usr/contrib/bin,) type 'fs', then
hit 'shift-User/System' (i.e. the key in between the function keys).  You
can then hit 'Menu' to make the function names dis/appear (though the
functions will still be attached to the keys either way).

The functions are:

    The first four allow you to set a directory location and easily return
    to it, or send stuff to it using the variable names.

	f1 & f3 - sets variable $here1 or $here2 to the current directory.
	f2 & f4 - goes to the directory set by $here1 or $here2.

    The next four are for checking what processes are running and doing
    specialized directories.

	f5 - shows only my own processes.
	f6 - shows files >= 10000 characters (good for cleaning up).
	f7 - shows all executables (except 'ln -s' executables).
	f8 - shows all directories.

I'm sure you'll want to customize the script to your own needs.  The only
thing you really need to know is that the field in 'fs' in columns 20-21 must
be equal to the total number of real characters (e.g. not "\" characters used
to quote the next character) in your command.

If there's interest, I'd be willing to post other short tools I've made.
I'd also love to see other people's tools posted.  For example, does anyone
have a nice .kshrc, or .exrc, or .elmrc, or other .*rc files that they feel is
worth having?  If so, please post.

Enjoy!

Eric Haines, 3D/Eye, Inc.  ...!hpfcla!hpfcrs!eye!erich


# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Eric Haines on Wed Jan 18 12:09:35 1989
#
# This archive contains:
#	fs	
#

LANG=""; export LANG
PATH=/bin:/usr/bin:$PATH; export PATH


rm -f /tmp/uud$$
(echo "begin 777 /tmp/uud$$\n \nend" | uudecode) >/dev/null 2>&1
if [ -f /tmp/uud$$ ]
then
	rm -f /tmp/uud$$
	unpacker=uudecode
else
	echo Compiling unpacker for non-ascii files
	pwd=`pwd`; cd /tmp
	cat >unpack$$.c <<-'EOF'
	#include <stdio.h>
	#define DEC(c)	(((c) - ' ') & 077)
	main()
	{
		int n;
		char dest[128], a,b,c,d;

		scanf("begin %o ", &n);
		gets(dest);

		if (freopen(dest, "w", stdout) == NULL) {
			perror(dest);
			exit(1);
		}

		while ((n=getchar()) != EOF && (n=DEC(n))!=0)  {
			while (n>0) {
				a = DEC(getchar());
				b = DEC(getchar());
				c = DEC(getchar());
				d = DEC(getchar());
				if (n-- > 0) putchar(a << 2 | b >> 4);
				if (n-- > 0) putchar(b << 4 | c >> 2);
				if (n-- > 0) putchar(c << 6 | d);
			}
			n=getchar();
		}
		exit(0);
	}
	EOF
	cc -o unpack$$ unpack$$.c
	rm unpack$$.c
	cd $pwd
	unpacker=/tmp/unpack$$
fi

echo x - fs '[non-ascii]'
$unpacker <<'@eof'
begin 555 fs
M(R!4:&ES('-H96QL('-I;7!L>2!S971S('5P(&9U;F-T:6]N(&ME>7,@9F]R
M(&%N($A0(#(S.3)!('1O(&UY('-P96-S("T@17)I8R!(86EN97,*(PHC(&9O
M<FUA="!I<SH*(R @(" @(" \15-#/B9F('MA='1R:6)U=&5](&$@>VME>2!N
M=6UB97)](&L@>VQA8F5L(&QE;F=T:'T@9"![<W1R:6YG(&QE;F=T:'T@3"![
M;&%B96Q]('MS=')I;F=]"B,*(R![871T<FEB=71E?2!I<R @,#IN;W)M86P[
M(" Q.FQO8V%L(&]N;'D[(" R.G1R86YS;6ET(&]N;'D*(PH*(R @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" Q,C,T-38W.#DP,3(S-#4V
M-S@Y,#$R,S0U-C<X.3 Q,C,T-38W.#DP,3(*96-H;R B7# S,R9F,&$Q:S$V
M9#0X3" @<V5T(#$@(%PD:&5R93$@:&5R93$]7&!P=V1<8#ME>'!O<G0@:&5R
M93$[96-H;R!<7%PD:&5R93$@:7,@7"1H97)E,0TB"F5C:&\@(EPP,S,F9C!A
M,FLQ-F0S-4P@("!C9" Q("!<)&AE<F4Q(&-D(%PD:&5R93$[96-H;R!D:7)E
M8W1O<GD@;F]W(%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