Check if last command result (passed in input). If result is equal to res_value param print message to stdout and exit with value 1.
Parameters:
$1
: result value of the command$2
: check if result value is equal to this value. (numeric value)$3
: message to print if result is not equal to zeroCheck if last command result. If result is not equal to 0 then print a message to stdout and exit with value 1.
Parameters:
$1
: message to print if result is not equal to zero.Print input message and exit with value 1 if second parameter is not equal to 0.
Parameters:
$1
: message to print on stdout.$2
: optional field to avoid call to exit program if value is equal to 0.Check if variable with name in input contains a string or not.
Parameters:
$1
: name of the variable to check.Returns:
1
: length of the variable is zero0
: length of the variable is not zeroEscape content of the variable with input name.
Parameters:
$1
: name of the variable to check.Returns:
0
: alwaysEscape content of the variable with input name like escape_var with octets ascii code.
Parameters:
$1
: name of the variable to check.Returns:
0
: alwaysUse to generate an input question and manage response.
Parameters:
$1
: message with question for user.Returns:
0
: if user answer is yes.1
: if if user answer is no.2
: if user answer empty.Push spaces to stdout.
Parameters:
$1
: Number of spaces to write.Returns:
0
: alwaysCreate a string with input "str" param at begin and N spaces where N is equal to max_chars - ${#str}
Parameters:
$1
: (var_name) Name of variable where save string with spaces.$2
: (max_chars) Number of max chars of the string with spaces.$3
: (str) String to insert at begin of save string.$4
: (pre_spaces) Number of spaces to add before str. (Optional. default 0).Returns:
0
: on success1
: on errorCheck if a program is available on current PATH.
Parameters:
$1
: (program) Name of the program.$2
: (options) Override default (-v) option on check presence. Optional.Returns:
0
: if program exists1
: if program doesn't exists or invalid input params.