File: libbash_developer_faq.dox

package info (click to toggle)
libbash 0.9.11-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 776 kB
  • sloc: sh: 1,402; makefile: 53
file content (27 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
\page libbash_developer_faq libbash - Developer FAQ

Welcome to libbash FAQ page!

This page contains list of most known problems you may run into while developing a bash libarary.

\section libbash_developer_faq_questions The Questions
	\subsection libbash_developer_faq_Q1 Question 1
		How can I use a \c local variable as an \c array ?
	\subsection libbash_developer_faq_A1 Answer 1
		When using a \c local variable, the line:
		\verbatim local VAR_NAME \endverbatim
		is used as a declaration of \e VAR_NAME.
		Unless implicitly mentioned otherwise, \c declaire creates a `regular' variable.
		Because of that, in order to use a local array you must implicitly declaire that it is an array:
		\verbatim declaire -a local ARR_NAME \endverbatim

	\subsection libbash_developer_faq_Q2 Question 2
		Using \ref hashstash_man "hashstash (3)"
		hashes, How do I declare a \c local \c hash?
	\subsection libbash_developer_faq_A2 Answer 2
		You can't. The reason for that is that every \c hash created by
		\c hashstash
		 is created as a hashstash internal variable. I.e. the actual name of the hash is not \c HASHNAME but \c __hashstash_HASHNAME.

*/