NBash
57 строк · 1.2 Кб
1#!/bin/bash
2# -*- tab-width: 4; encoding: utf-8 -*-
3#
4## @file
5## @author Damien Nadé <bash-argsparse@livna.org>
6## @brief Bash Doxgen Unit Test
7## @copyright WTFPLv2
8## @version 1
9##
10
11declare -r readonly
12declare -r assigned_readonly=readonly-value
13declare -a array
14declare -a assigned_array=(1 2)
15declare -A associative_array
16declare -A assigned_associative_array=([x]=1 [y]=2)
17declare -i integer
18declare -i assigned_integer=2
19declare -x declared_exported
20declare -x assigned_declared_exported=1
21
22declare -ri readonly_integer
23declare -ri assigned_readonly_integer=2
24
25declare -rix readonly_exported_integer
26declare -rix assigned_readonly_exported_integer=3
27
28declare -rA readonly_associative_array
29declare -rA assigned_readonly_associative_array=([a]=2 [b]=3)
30
31declare -l lowercase
32declare -l assigned_lowercase=l
33
34declare -u uppercase
35declare -u assigned_uppercase=U
36
37export exported
38export assigned_exported=1
39
40## @fn function_1()
41## @brief 1st function
42## @param param1 first parameter
43##
44## Don't skip empty line above
45function_1() {
46bogus
47bogus2;
48}
49
50## @fn function_2()
51## @brief 2nd function
52## @param param1 first parameter
53## @param param2 second parameter
54function function_2() {
55bogus
56bogus2;
57}
58