Path: utzoo!attcan!uunet!mcsun!unido!cosmo2!mdnet@cosmo.UUCP From: mdnet@cosmo.UUCP (Dr. Carsten Emde/Klinikum Steglitz der FU Berlin) Newsgroups: comp.os.os9 Subject: Browse (part 1 of 3) Keywords: source Message-ID: <4474@cosmo2.UUCP> Date: 9 Jan 90 08:04:25 GMT Sender: news@cosmo2.UUCP Reply-To: mdnet@cosmo.UUCP (Dr. Carsten Emde/Klinikum Steglitz der FU Berlin) Organization: CosmoNet, D-3000 Hannover 1, FRG Lines: 142 >From unido!zedat.fu-berlin.dbp.de!EMDE Mon Jan 8 10:11:07 1990 Received: by cosmo.UUCP (sendmail 5.61++/1.3) id AA01218; Mon, 8 Jan 90 16:11:18 +0100 Received: from gmdzi.UUCP (gmdzi) (1254) by unido.informatik.uni-dortmund.de for cosmo id AL21947; Mon, 8 Jan 90 11:00:10 +0100 Received: by gmdzi.UUCP id AA07368; Mon, 8 Jan 90 11:03:13 -0100 Date: 6 Jan 90 12:22 +0100 From: EMDE To: cosmo!mdnet Message-Id: <143:EMDE@zedat.fu-berlin.dbp.de> Subject: Browse (part 1 of 3) Status: RO Organization: Klinikum Steglitz, FU Berlin, Gastro-Labor X-Mailer: O-X-M [v1.3d] A very helpful utility appeared once in comp.sources.misc which I have ported to OS-9. This utility displays an ls-like directory listing on screen and allows to walk around in the directory tree and to inspect, dump, rename,, copy, edit, execute etc. files and directories. It was written by Peter da Silva who proposed to post it to comp.os.os9. To compile this *NIX program TOP's os9lib is required. Since not all OS-9 users may have this library available, I have uuencoded the ready-to-use object module and posted as well. Requests and proposals: ---------------------- 'browse' in general: Peter da Silva (peter@ficc.uu.net) 'browse' OS-9 implementation: Carsten Emde (emde@zedat.fu-berlin.dbp.de) ---- Cut Here and unpack ---- #!/bin/sh # OS-9/xshar: Shell Archiver (v1.22) # Packed January 6, 1990 Saturday 11:49:38 am by carsten # from directory /h0/SYSSRC/BROWSE # # Run the following text with /bin/sh to create: # /h0/SYS/browse.hlp # makefile # sed 's/^X//' << 'SHAR_EOF' > /h0/SYS/browse.hlp && XBrowse is a screen-oriented directory browser, based on the metaphor of using X'VI' to edit an 'ls -l' listing. X XCommands: X SPACE Change directory (if cursor points to a directory). X SPACE Page file through 'more' (if cursor points to a file). X x Hex dump of current file or directory. X & Run a program that won't clobber the screen. X $ Run a program. X = Enter a directory name. X ? Page this help file through 'more'. X [ Define a macro. X H Go to the top of the page. X J Go to the bottom of the directory. X K Go to the top of the directory. X L Go to the bottom of the page. X ^L Repaint screen. X M Display macros. X S Save macros. X I Install macros from current file. X . Go down 20 lines. X o Go up 20 lines. X R Rename a file. X dd Delete file(s). (ask for verification) X DD Delete file(s). X h Place cursor at beginning of line. X l Move cursor to end of line. X < Display file names only. X > Display long directory listing. X , Go down a line. X k,^K Go up a line. X n,^D Go down 11 lines. X p,^U Go up 11 lines. X X qq,QQ,ZZ Exit. X X r Re-read directory. X X t Toggle tag on current file or directory. X T Tag all files. X U Untag all files or directories. X XMacros: X [xtext] Define x as text. X XWithin text: X % Current filename(s). X # Current directory. X ! Previous command. X $x Macro for key x X $$ Current process ID X ~ Home directory. X ^K One character from previous command. X @x Execute macro for key x X \x Enter special character x X \nnn nnn, octal X \^x Control-x X XDefault macros: X b =.. X ~ =~ X % $% X SPACE $more % X c $copy % X s $scred % X XWhen a command is executed (using '$'), the environment in the form Xpresent at start of 'browse' will automatically be passed to . In Xaddition, the environment variable FILE will be set to the current file name. SHAR_EOF chmod 0003 /h0/SYS/browse.hlp || echo "restore of /h0/SYS/browse.hlp fails" sed 's/^X//' << 'SHAR_EOF' > makefile && XTARGET=browse XDEBUG= X XHOME=/h0/ XCFILES=$(TARGET).c XOFILES=$(TARGET).r XHELP=$(HOME)SYS/$(TARGET).hlp XCFLAGS=-ixt=/dd/TMP $(DEBUG) XLFLAGS=-ixe=10 XLIBS=-l=/dd/LIB/os9lib.l -l=/dd/LIB/termlib.l XEXEC=$(HOME)CMDS/ X X$(TARGET): $(OFILES) X cc $(LFLAGS) $(OFILES) $(LIBS) $(DEBUG) -f=$(EXEC)$(TARGET) X attr $(EXEC)$(TARGET) -pe X uuencode $(EXEC)$(TARGET) >-$(TARGET).uu X xshar -c -D $(HELP) makefile >$(TARGET)01 X xshar -c -D $(CFILES) >$(TARGET)02 X xshar -c -D $(TARGET).uu >$(TARGET)03 X X$(OFILES): $(CFILES) SHAR_EOF chmod 0003 makefile || echo "restore of makefile fails" exit 0