HP3000-L Archives

January 1997, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Vance <[log in to unmask]>
Reply To:
Jeff Vance <[log in to unmask]>
Date:
Mon, 20 Jan 1997 10:13:23 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (60 lines)
On Jan 18, 11:00am, Jeff Kell wrote:
> Subject: Re: Subject matter on the List
> Jeanette and Ken Nutsford wrote:
> > How about some of the Posix gurus posting command file scripts that do some
of
> > the useful Posix things so that the rest of us can start using the half of
> > MPE/iX that we are paying for but not utilising.

This is a great idea.  I imagine most of these scripts are short, but if
so desired we can put some of them on jazz.  An interesting special case
are scripts that use MPE and POSIX together via the 'callci' shell command.

...
> Example:  You want to replace a file/program/SL/etc but someone is accessing
> the file (:listf,2 shows the dreaded asterisk by the filename).
>
> Solution:
>    (1) either :RM.HPBIN.SYS "/ACCT/GROUP/FILE"   (removes file completely)
>            or :MV.HPBIN.SYS "/ACCT/GROUP/FILE /ACCT/GROUP/OLDFILE" (renames)
>    (2) :MV.HPBIN.SYS "/ACCT/GROUP/NEWFILE /ACCT/GROUP/FILE"
>            or just :RENAME NEWFILE,FILE
>
> Or in shell, just "shell/ix> rm /ACCT/GROUP/FILE"
>                   "shell/ix> mv /ACCT/GROUP/NEWFILE /ACCT/GROUP/FILE"

Remember that in POSIX the shell does all wildcard expansion -- meaning
the shell parses the command line looking for POSIX wildcard characters
(*, #, ?, [, ]).  If any are found the directory is searched for all
matches.  All matches are inserted into the command line as if the user
actually entered these names her/himself.  The actual command, like mv or rm,
does not see the original wildcard names -- it sees a list (somtimes very
long) of filenames that match.  This matters if you invoke the POSIX
command program (eg. MV.HPBIN.SYS) from the CI (no wildcarding) versus the
shell (wildcard expansion).

> The posix "rm" is actually an "unlink" - it removes the filename from the
> directory, but the file continues to exist (for current users); when the user
> count reaches zero, the file is actually purged....

The CI :PURGELINK command is also an interface to the POSIX unlink() function.

> Example:  You've started playing with Posix and you're trying to find some
> file "foobar" that resides in some HFS directory somewhere.  :listf @[log in to unmask]@
just
> won't cut it; (some variant of :listfile /@ will, I think, though).
>
> Solution:  shell/ix> find / -name foobar

There is a FINDFILE UDC in the HPPXUDC.PUB.SYS file.  FINDFILE will locate
files by executing the LISTFILE command.  Note: the POSIX find command
is quite a bit more powerful!  There are also FINDDIR, LISTDIR and some
utility routines in this same UDC file.

... more good examples snipped.

regards,
Jeff Vance, CSY

--

ATOM RSS1 RSS2