![]() Test -f "$run_unit_bash_dir/$run_unit.$host_name.cnf" \ # however if there is a host dependant cnf file override it ![]() Note the MainSectionĬnf_file="$run_unit_bash_dir/$run_unit.cnf" # cleans the unneeded during after run-time stuff. # parse the ini like $0.$host_name.cnf and set the variables Of course, in a real applied script, you need to add a lot of stuff to make sure the arguments are correct, decide what to do when input is incorrect, settings file does not exist etc, but: Subsequently, to print out the string, as defined in your "configfile": $ '/home/jacob/Bureaublad/test.sh' printĮen aap op een fiets, hoe vind je zoiets? To set a string into your config file: $ '/home/jacob/Bureaublad/test.sh' set "Een aap op een fiets, hoe vind je zoiets?" # if the argunment is "print": print out the set string, as defined in your file # if the argument is: "set", write the string (second argument) to a file # argument to set a new string or print the set string In the example below, you can use a (very) basic script to either set a string, or print a string, as set in your config file: #!/bin/bash Obviously, I am not the bash specialist here, but the concept should not be different in whatever language you use: An example You could inadvertently break that more easily than a sourced file.) (You could also do something like eval "$var=$value", but that's riskier than sourcing a script. Then you could do something like: while read var value If you really must process configuration of the form: var1 some value 1 This file is used to set configuration options for GRUB, since grub-mkconfig is a shell script that sources it: sysconfdir="/etc" A very common example from posts here is /etc/default/grub. The many files in /etc/default usually serve as configuration files for other shell scripts in a similar way. For example, your config file (say nfig) would be: var1=val1Īnd your script could look like: #! /bin/bash When producing DocBook, it becomes a DocBook refmiscinfo attribute and appears in the footer.As mbiber said, source another file. The source to which the man page pertains. ![]() Must include both the man page name and volume number.Īlternative way to set the command purpose. Built-in document attributes for man pages AttributeĬan be set by overriding the doctitle attribute. These attributes (or the attributes from which they are derived) must be set in the document header. Several built-in document attributes only affect the manpage doctype and output. The second section is recommended and, if present, must be titled “Synopsis” (or “SYNOPSIS”). If multiple names are given, Asciidoctor will generate alias files for the secondary names that point to the primary name. The dash must have at least one space character on either side. The first section is mandatory, must be titled “Name” (or “NAME”), and must contain a single paragraph (usually a single line) consisting of a list of one or more comma-separated command name(s) separated from the command’s purpose by a dash character (e.g., progname - does stuff or name1, name2 - does stuff). Refer to the Document attributes section. There are several built-in document attributes that impact how the source is parsed and converted when the manpage doctype is in use. The volume number is a single digit optionally followed by a single character. The doctitle consists of the program name followed by the volume number in round brackets (e.g., progname(1)). In a man page, the document header is mandatory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |