Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 53604

Questions on function usage in the context of Unix & Linux (mostly but not exclusively shell scripts). Questions on programming in Python, Perl, Ruby, etc. should be asked on Stack Overflow.

9
votes
The command in question from that example looks like: echo ${arrayZ[@]/%e/$(replacement)} The example later states: # $( ... ) is command substitution. # A function runs as a sub-process … . Being charitable to ABS Guide, what they apparently meant to write is that the function runs inside a command substitution and the command inside a command substitution runs in a subshell. …
answered Aug 23 '16 by John1024
8
votes
I don't think that there is just one good way to do this. Many functions, scripts, and other executables provide a help message if the user provides -h or --help as an option: $ foo() { [[ "$1" =~ ( …
answered Jul 10 '16 by John1024
39
votes
In my comment, I mentioned three advantages of functions: They are easier to test and verify correctness. Functions can be easily reused (sourced) in future scripts Your boss likes them. And, neve …
answered Sep 29 '16 by John1024
6
votes
=delegate_function Anytime that you want to use parent_function to dispatch delegate_function, just run: $ $parent_function output from delegate Example of dynamic function update Let's define … delegate_function. Example of dynamic choice of name Let's create our delegate function: $ delegate_function() { echo "delegate function executed"; } Let's assign some name: $ parent_function …
answered May 11 '16 by John1024
17
votes
which no alias has been defined. Regarding functions, man bash explains that declare can provide still more information is available if the extdebug option is set: Function … names and definitions may be listed with the -f option to the declare or typeset builtin commands. The -F option to declare or typeset will list the function names only (and optionally …
answered May 9 '14 by John1024