JoeX skrev:
> Jeg har aldrig set eksempler eller dokumentation på funktions-
> argumenter.
Så har du en hel del til gode.
Fra "man bash":
#v+
Shell Function Definitions
A shell function is an object that is called like a simple command and
executes a compound command with a new set of positional parameters.
Shell functions are declared as follows:
[ function ] name () compound-command [redirection]
This defines a function named name. The reserved word function
is optional. If the function reserved word is supplied, the
parentheses are optional. The body of the function is the com-
pound command compound-command (see Compound Commands above).
That command is usually a list of commands between { and }, but
may be any command listed under Compound Commands above. com-
pound-command is executed whenever name is specified as the name
of a simple command. Any redirections (see REDIRECTION below)
specified when a function is defined are performed when the
function is executed. The exit status of a function definition
is zero unless a syntax error occurs or a readonly function with
the same name already exists. When executed, the exit status of
a function is the exit status of the last command executed in
the body. (See FUNCTIONS below.)
#v-
> Hvad betyder #v+ og -? Er det det samme som "set -x"?
Nej, det er et sæt markører der fortæller slrn at de mellemliggende
linjer ikke skal ombrydes.
Mvh,
--
Klaus Alexander Seistrup
http://klaus.seistrup.dk/