Whence command behaviour #900
Unanswered
ravindra-shinde2
asked this question in
Q&A
Replies: 1 comment
-
|
Both cases should print 0. Case 1 should print 0 because If you want to see if something is specifically defined as a function, try $ function func { true; }
$ whence -f func | grep -c func
0
$ whence -p func | grep -c "func"
0
$ typeset -f func | grep -c func
1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve noticed that the whence builtin doesn’t seem to behave as expected.
Test case:
$ function func { true; } $ whence -p func | grep -c "func" $ whence -f func | grep -c "func"My understanding is:
whence -f func | grep -c "func"→ should print 1 (function definition).whence -p func | grep -c "func"→ should print 0 (since -p searches only the path, not functions)Is my understanding correct? What should the expected outputs be here? Should both cases actually print 0?
Beta Was this translation helpful? Give feedback.
All reactions