• Aucun résultat trouvé

SEE ALSO bif( 4), ls(l)

Dans le document HP-UX Reference (Page 94-107)

Hewlett-Packard Company - 2 - Version B.1, October 1986

BIFMKDffi(l) HP-UX BIFMKDffi(l) Series 200, 300, 500 Only

NAME

bifmkdir - make a BIF directol'y SYNOPSIS

bifmkdir device:dirname ...

DESCRIPTION

Bifmkdir is intended to mimic mkdir{I}.

A BIF file name is recognized by the embedded colon (:) delimiter (see bi/(4) for BIF file naming conventions) .

Bilmkdir creates specified directories in mode 777. The standard entries, . for the directory itself, and .. for its parent, are made automatically.

RETURNS

Bilmkdir returns exit code 0 if all directories were successfully made; otherwise, it prints a diag-nostic and returns non-zero.

EXAMPLES

Create an empty subdirectory named sysmods under the directory /usr/lib on HP-UX device /dev /dsk/2s0:

bifmkdir /dev /dsk/2s0:/usr/lib/sysmods AUTHOR

Bil was developed by HP.

SEE ALSO

bif(4), mkdir{I).

Hewlett-Packard Company - 1 - Version B.l, October 1986

BIFRM(l) HP-UX BIFRM{l}

Series 200, 300, 500 Only

NAME

bifnn, bifnndir - remove BIF files or directories SYNOPSIS

bifrm [ -fri

1

device:file ...

bifrmdir device:dir ...

DESCRIPTION

Bi/rm and bi/rmdir are intended to mimic rm(l) and rmdir(l).

A BIF file name is recognized by the embedded colon (:) delimiter (see bi/(4) for BIF file naming conventions).

Bi/rm removes the entries for one or more files from a directory. If an entry was the last link to the file, the file is destroyed.

If a designated file is a directory, an error comment is printed (unless the optional argument -r has been used, see below).

The options are:

-f removes a file with no questions asked, even if the file has no write permission.

-r causes bi/rm to recursively delete the entire contents of a directory, and then the directory itself. Bi/rm can recursively delete up to 17 levels of directories, -i causes bi/rm to ask whether or not to delete each file. If -r is also specified, hifTm

asks whether to examine each directory encountered.

Bi/rmdir removes entries for the named directories, which must be empty.

EXAMPLES

The following examples assume that an BIF directory structure exists on the HP-UX device file /dev /rdsk/lsO.

The first example recursively combs through the BIF directory /tmp and f\.<;ks if each BIF filp should be removed (forced, with no file mode checks):

bifrm -irf /dev /rdsk/lsO:/tmp

The second example removes the BIF directory /users/doug:

bifrmdir /dev /rdsk/lsO:/users/doug AUTHOR

Bi/rm was developed by HP.

SEE ALSO

bif(4), nn(l), nndir(l).

Hewlett-Packard Company - 1 - Version B.l, October 1986

BS(I) HP-UX BS(I)

NAME

bs - a compiler/interpreter for modest-sized programs SYNOPSIS

bs [ file

I

args

1 1

DESCRIPTION

Bs is a remote descendant of Basic and Snobol4 with a little C language thrown in. Bs is designed for programming tasks where program development time is as important as the resulting speed of execution. Formalities of data declaration and file/process manipulation are minimized.

Line-at-a-tirue debugging, the trace and dump statements, and useful run-time error messages all simplify program testing. Furthermore, incomplete programs can be debugged; inner functions can be tested before outer functions have been written and vice versa.

If the command line file argument is provided, the file is used for input before the console is read. call). The details of expressions follow the description of statement types below.

Break exits from the innermost for/while loop.

Clears the symbol table and compiled statements. Clear is executed

Succeeding statements are compiled (overrides the immediate execution default).

The optional expression is evaluated and used as a file name for further input. A clear is associated with this latter case. Compile is executed immediately.

Continue transfers to the loop-continuation of the current for/while loop.

The name and current value of every non-local variable is printed. Optionally,

Hewlett-Packard Company - 1 - Version B.1, October 1986

BS(l) HP-UX BS(l)

exit [ expression ]

Return to system level. The expression is returned as process status.

execute Change to immediate execution mode (an interrupt has a similar effect). This statement does not cause stored statements to execute (see run below).

for name = expression expression statement for name

=

expression expression

next

for expression , expression ,expression statement for expression , expression , expression

next The for statement repetitively executes a statement (first form) or a group of statements (second form) under control of a named variable. The variable takes on the value of the first expression, then is incremented by one on each loop, not to exceed the value of the second expression. The third and fourth forms require three expressions separated by commas. The first of these is the initialization, the second is the test (true to continue), and the third is the loop-continuation action (normally an increment).

fun f( [a, ...

1)

[v, ...

1

nuf

freturn

goto name ibase N

Fun defines the function name, arguments, and local variables for a user-written function. Up to ten arguments and local variables are allowed. Such names can-not be arrays, nor can they be I/O associated. Function definitions may can-not be nested. Calling an undefined function is permissible, see function calls below.

A way to signal the failure of a user-written function. See the interrogation operator (?) below. If interrogation is not present, freturn merely returns zero.

When interrogation is active, freturn transfers to that expression (possibly by-passing intermediate function returns).

Control is passed to the internally stored statement with the matching label.

[base sets the input base (radix) to N. The only supported values for N are the constants 8, 10 (the default), and 16. Hexadecimal values 10--15 are entered as a-f. A leading digit is required (i.e., roa must be entered as OfOa). [base (and obase, below) are executed immediately.

if expression statement if expression [else ... ]

fi The statement (first form) or group of statements (second form) is executed if the expression evaluates to non-zero. The strings 0 and n n (null) evaluate as zero. In the second form, an optional else allows for a group of statements to be executed when the first group is not. The only statement permitted on the same line with an else is an if; only other fi's can be on the same line with a fi. The concatenation of else and if into an elif is supported. Only

a

single

fi

is required to close an if . .. elif·.. [ else . .. 1 sequence.

include expression

The expression must evaluate to a file name. The file must contain bs source statements. Such statements become part of the program being compiled.

Hewlett-Packard Company - 2 - Version B.1, October 1986

B8(1) time onintr was executed. The effect of the statement is cleared after each inter-rupt. In the second form, an interrupt will cause bs to terminate.

stop Execution of internal statements is stopped. Bs reverts to immediate mode.

trace [ expression ]

The trace statement controls function tracing. If the expression is null (or evalu-ates to zero), tracing is turned off. Otherwise, a record of user-function calls/returns will be printed. Each return decrements the trace expression value.

while expression statement while expression

next While is similar to for except that only the conditional expression for loop-continuation is given.

! shell command An immediate escape to the Shell.

# ...

This statement is ignored. It is used to interject commentary in a program.

Expression Syntax:

name A name is used to specify a variable. Names are composed of a letter (uppercase or lowercase) optionally followed by letters and digits. Only the first six charac-ters of a name are significant. Except for names declared in fun statements, all

Hewlett-Packard Company - 3 - Version B.l, October 1986

BS(i.)

!! 1,( ':'!.i<J ·:~;\:~lf!':n~ j ~P:~, .~L ~ J"" \ -i,.

,1' , .... , ... ; ,I.,

,', :

-1

Th I; nS(i)

.~-: :::H~ \'::"!:1\' :~f tht' i~·th ;~,~t1i.;:d p.~,L~IJH·;~Ar ~;H l!:1,.:'" L: ... JTf·~lt ic''.,~el Df fUllCt]Gll ra.ll At l<..:'.t,l i~~r(J~ U.t~1 }'"<:tIH[j~ t;~fi ~'~fL f(~~HT~.1::t!!~1·h~1~ ~~rgur,::lr-It:- i:~r!J(t)) returus ~s»

AJ arhrrnati(

r;'~ ··!r~:~ thr fnrr:l ~r.rt:d "flf":d' . .lf 1')1' a. It' l~, ~j,s~~;.!rn(~j tt) ;)1;> ;}, fdrrnat ~~)e('itit'4t ion in 11.,' :;;.v;(' (,f pnntji'lSI, (mfy tili: ~~; ..• f, ':,c~ ••. e, aTid % ... 8 types are saf.:,

t, it 1', i:il! ::!W:IY:: ;),)$sihle tu KJ.lOW wht'tlJ{'r a if) a :j1H:lber m a string Whf'!l fc,r:l1:,t :ail ,:- ("h:ed L)(,[(,jq:; a ttl the type reqilin·d by f hy eitlH'r addGlg

7{

:r.,,,

e ;)1' t f()rtll!i.l) tlr CUIl,atellCi!,ilg f _) !~;(' ,;:tr;ll{, (for s format) shou!d HtdrTI:- th' ~::'Lltlt'r A til'" i:r-st jlusiti:)rl ill x thaI ~uy •• [ the chara.ctn·;, from 1;

.tu~-t~ ;'he:~'L 1'\/:, It.lat {h ylrl(l~·~ l£r:'

tft" i5; tLc ~<l:';t· P\\:~i~ !\Hl ~:J t ;:)dur('(~ ('h;\r;v',~ten, t.~lli.t l;,)t '1;)j)C:1r ill

J

'irf'

~. n.lrr'i c:i.:1.rac tt"l:-::: th..i~

'··'-1\:':· ... ~ ';, ;;,.' ._,t-l'";~t !i!n;'{T ~ q~'_11,('2!. l:l tLr f'X~''; pnrr: ;:~

'.lr

j d·'l ~;!'.t "'t,~J!.;::' ~J l!:. f~,!·

<lhsjr(,;, ,.;t:~ ',. v,j!lth)

~~'\'dr~J'" 1.1H >':lL"~l;!':ll~ of" ,h'fiLt.'d h~l !IiC' starting p:)S~t>')7'1 anr} u)idt/i, 1 Lt-, i"'l[l( r!l

rj'~}(. {,~i;ir:-:c' {ll

to t Le 1 cgular (~xpr('.;;,~jdn· 8,.'lI; t.1X .!i' t hp ed(.1) C()llH1Ja:i,j

J', Lj~~jl~; Ll~1.~·k(·t,<)~

*

~rn;l f. ~H'~_' ~ih~(·j;;1L 1 iH" Tfl$!.,11tj i-'lllr~j(in r~~!:;r~>: r~·<!L {: <,--= l! <=--:: iU} ~\jh~.triIlg ~.1f ~~le :";\lhj{Jt~ th~~t 0CCUrr(·,j th t'.\'('f;1 ~';_1.1J'~ 1)1' 1~1.(' pati€f!l SYLiLoi.'~: \{ alHl \) for the nlost re('t"!lt caU t~~

71';

k,;.',' .... '11;, ~,

'r

th:-b{-l~i'LliIlg of t!:e ~tri!lt! l:.J7; if ~L::

r,,'~ (E'~-~~ t

:k'

Il~<llnht~r .;{ l'~·i.dr:.~ tl:r"··

B8(1) HP-UX

match("aI23abI23", ".*\([a-z]\)")

==

6 mstring(l)

==

"b"

Examples are given in the following section.

executes access(2).

A table in bs is an associatively accessed, single-dimension array. "Subscripts"

(called keys) are strings (numbers are converted). The name argument must be a bs variable name (passed as a string). The size argument sets the minimum number of elements to be allocated. Bs prints an error message and stops on table overflow. The result of table is name.

The item function accesses table elements sequentially (in normal use, there is no orderly progression of key values). Where the item function accesses values, the key function accesses the "subscript" of the previQus item call. It fails (or in the absence of an interrogate operator, returns null) if there was no valid subscript for the previous item call. The name argument should not be quoted. Since exact table sizes are not defined, the interrogation operator should be used to detect end-of-table; for example:

table("t", 1(0)

#

If word contains "party", the following expression adds one

#

to the count of that word:

Hewlett-Packard Company - 6 - Version B.l, October 1986

BS(1) crude fonn of indirection, as in:

name = "xyz" eVal("++"_ name)

which increments the variable xyz. In addition, eval preceded by the interroga-tion operator pennits the user to control bs error conditions. For example:

?eval("open(\ "X\", \"XXX\", \"r\ "t)

returns the value zero if there is no file named "XXX" (instead of halting the user's program). The following executes a goto to the label L (if it exists):

label="L"

if !(?eval("goto "_label» puterr = "no label"

plot(request, args)

labels the current point with string.

draws the line between (xl,yl) and (x1!,y1!).

draws a circle with center (x,y) and radius r. and (x1!,y1!) the upper right comer of the plotting area.

causes subsequent x (y) coordinates to be multiplied by xl (yl) and then added to x1! (y1!) before they are plot-ted. The initial scaling is plot(12, 1.0, 1.0,0.0,0.0).

Some requests do not apply to all plotters. All requests except zero and twelve are imple-mented by piping characters to tplot(l). See plot(4) for more details.

Each statement executed from the keyboard re-invokes tplot, making the results unpredictable if a complete picture is not done in a single operation. Plotting should thus be done either in a func-tion or a complete program, so all the output can be directed to tplot in a single stream.

last ( ) in immediate mode, last returns the most recently computed value.

Programming Tips:

Hewlett-Packard Company - 7 - Version B.l, October 1986

BS(J}

$ ~::s

#- D!",,!<:';!~·I' (i::ch",,) li~;H i r~Wl'!" :~. ", i"i.L(.~.:,r("l(:

~ ~6(jUU .. G!::;i.' " 12

i

kJ l.~. ~J; B4ftO

L",:~~ :.:::: l~~i,~;'_<

L:·.~ i =- 1 ~* ~ h;'l ~ hd.]

34fL85flOG7

·"'.:·l = 1

#(

# l:,_~t :.:L)~('r·-~{'i-,t c'«\r~'~(1·i t(lX~: ~Ir "',U;;ti:

,·;,jr

. ~.: ~ Ind. tt, . 1 "

\\

-~

-!d(l)

.. 1,1

'1":,.

BS\1)

,;,'1 f ' ; ~l}. <H·(>p~;-..:;2 .. T\r;:;t~'(,~;~: ~i 11.~·i ;_:!,~~,:4;

,-}\! iq~' ~1 f~:r':,fr ~'tfS(Ti:~! ')! ~~1f" L·~:ttht'>~_l:;('~·d :~j:Ht ~~,1:'; (p~")~ ;"'jj ·~.Tp(:('·1) ~~. ~!(;:r ~

.11r':Y 1 u}{'r,u:~' d ~o:nc~ f' rn)J'I~;, :J i~t ~.,'pijlj~· a

lu.n

di."'Cldr:·1t ion i:-: pai!lfuL :1-<: tl Iif\\

~d;~~it t)P ~:·e ;'iL:.J..1e ,/,.:jt~-L>~it tt'H!;~ :1. [ifelr , ~:LHtiH6 ~U~i~.l~ l~!~ td£i ('::L~!!l~Ld i~. tl;.e b:es~

-:-} - \'ersiml 13.1. Ooobt>, 1080

CAL(l) HP-UX CAL(l)

NAME

cal - print calendar SYNOPSIS

cal [ [ month

1

year

1

DESCRIPTION

BUGS

Cal prints a calendar for the specified year. If a month is also specified, a calendar just for that month is printed. If neither is specified, a calendar for the present month is printed. Year can be between 1 and 9999. The month is a number between 1 and 12. The calendar produced is that for England and her colonies.

Try September 1752.

The year is always considered to start in January even though this is historically naive.

Beware that "cal 83" refers to the early Christian era, not the 20th century.

Hewlett-Packard Company - 1 - Version B.1, October 1986

CALENDAR(l) HP-UX CALENDAR (1)

NAME

calendar - reminder service SYNOPSIS

calendar [ - J DESCRIPTION

FILES

Calendar consults the file calendar in the current directory and prints out lines that contain today's or tomorrow's date anywhere in the line. Most reasonable month-day dates such as "Aug.

24," "august 24," "8/24," etc., are recognized, but not "24 August" or "24/8". On weekends

"tomorrow" extends through Monday.

When an argument is present, calendar does its job for every user who has a file calendar in the login directory and sends them any positive results by mail(l). Normally this is done daily in the early morning hours under control of cron(lM}.

calendar /tmp/cal*

/usr/lib/calprog to figure out today's and tomorrow's dates /usr/lib/crontab

/etc/passwd SEE ALSO

cron(lM), mail(l).

BUGS

Your calendar must be public information for you to get reminder service.

Calendar's extended idea of "tomorrow" does not account for holidays.

INTERNATIONAL SUPPORT

Dans le document HP-UX Reference (Page 94-107)