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 22565

is a process of finding and reducing the number of bugs, or defects, in a computer program, thus making it behave as expected

4
votes
As an approximation, you could do: trap '{ type -p -- "${BASH_COMMAND%% *}" >&3; } 3>&2 2> /dev/null' DEBUG set -o functrace -o xtrace The DEBUG trap is run before every command. During the executi …
answered Jan 13 '14 by Stéphane Chazelas
7
votes
To strace the shell doing cd /some/dir: { strace -p "$$" & sleep 1; cd /some/dir; kill "$!"; }
answered Sep 15 '13 by Stéphane Chazelas
19
votes
xtrace output goes to stderr, so you could redirect stderr to /dev/null: i_know_what_this_does() { echo do stuff } 2> /dev/null If you still want to see the errors from the commands run inside th …
answered Jan 2 '13 by Stéphane Chazelas
23
votes
There's often confusion between process forking and execution. When you do at the prompt of a bash shell. $ sh -c 'exec env ps' The process P1 issuing that $ prompt is currently running bash code. …
answered Jul 23 '16 by Stéphane Chazelas
5
votes
Using gcov: $ gcc -O0 --coverage square.c $ ./a.out $ gcov -i square.c $ awk -F '[,:]' '$1 == "function" && $3 > 0 {print $3, $4}' square.c.gcov 1 square 1 main (where the number is the number of t …
answered Aug 17 '17 by Stéphane Chazelas
2
votes
To have the executable print the function names as they are being called, on a GNU system, you can use gcc's -finstrument-functions option and dladdr() to translate addresses to function names. Creat …
answered Aug 18 '17 by Stéphane Chazelas
8
votes
I'm not aware of any shell that has such an operator. However, with most shells (ksh being the exception) you can silently toggle xtrace with: { case $- in (*x*) set +x;; (*) set -x esac …
answered Jan 5 '16 by Stéphane Chazelas
17
votes
On Linux, assuming you want to know what is writing to the same resource as your shell's stdout is connected to, you could do: strace -fe write $(lsof -t "/proc/$$/fd/1" | sed 's/^/-p/') That would …
answered Jul 2 '14 by Stéphane Chazelas