more script syntax

Rui Ferreira ruifmferreira at hotmail.com
Wed Oct 23 17:06:20 PDT 2002


From: "Eric Miller" <emiller at techskills.com>
To: <lfs-support at linuxfromscratch.org>
Sent: Thursday, October 24, 2002 12:51 AM
Subject: more script syntax


> Again, my apologies as a .bat scripter.
>
> What is the syntax to define a subroutine in a bash script- the equivalent
> of the old BASIC gosub return
>
> for example:

short, unpolite answer: type 'man bash' in the console

also short but more direct answer:

functions must be declared before usage
after that, just call them by their name

e.g.:
- to declare -
marker ( private_variable )
    bzcat private_variable ...

- to use -
marker bash-2.05a


another source of examples is the lfs-bootscripts as they use pre-declared
(and externally declared) functions.

Also, a totally different approach for making a lfs-install script is Conrad
Newton's script.
Google around for it...

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message



More information about the lfs-support mailing list