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 237982

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.

3
votes
" done } Which can then be called as: $ list ~/* What's wrong with your current function: When you call it with a glob, it passes each file in the directory as a separate argument. Let's say your …
answered Jun 2 '18 by Jesse_b
3
votes
and functions to be shared between all the scripts. To Function or Not to Function The main purpose of a function is DRY (Don't repeat yourself). If you have some code that will be used more than … once in your script it should be in a function. Using functions on non-repeating code is a matter of preference. Some people (myself included) consider it to be more neat. Additionally I think it …
answered Nov 14 '18 by Jesse_b
2
votes
Pipe sends the output of one command to the next. You are looking for the & (ampersand). This forks processes and runs them in the background. So if you ran: WatchDog & TempControl & GPUcontrol …
answered Sep 22 '17 by Jesse_b
5
votes
When you use: if ( foo $1 ) You are simple executing foo $1 in a subshell and if is acting on it's exit status. When you use: if [ foo $1 ] You are attempting to use the shell test and foo is n …
answered May 3 '18 by Jesse_b
2
votes
If you are only concerned with the line count of your file you could do something like this: my_func () { echo "Hello, world" } && my_func
answered Feb 15 '18 by Jesse_b
4
votes
be stored in $@. To accomplish your goal you could do something like: function loop { local command=$1 shift for i in "$@"; do "$command" "$i" done } This will set command … " "element3") $ loop echo "${arr[@]}" element1 element2 element3 $ loop printf 'hello ' 'world\n' hello world $ loop touch file1 file2 file3 $ ls file1 file2 file3 If you want this function to be …
answered Jun 22 by Jesse_b
2
votes
The last DWA is being removed because you are using this as your delimiter. The delimiters tell your shell everything between these matching strings is part of my here doc. The delimiters are not pa …
answered Dec 1 '17 by Jesse_b