Why does gnu which show a script instead of a file path
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I encounterd the following output while using which
[user@localhost ~]$ which gem
gem ()
I have seen which
show aliases but not bash scripts before.
This script obviously came from RVM but how did it get in to which
and where can I find it on my filesystem? It isn't in .bashrc
.
bash which
add a comment |Â
up vote
0
down vote
favorite
I encounterd the following output while using which
[user@localhost ~]$ which gem
gem ()
I have seen which
show aliases but not bash scripts before.
This script obviously came from RVM but how did it get in to which
and where can I find it on my filesystem? It isn't in .bashrc
.
bash which
Related: unix.stackexchange.com/a/85250/117549 -- quoting: "There is a GNU which which is probably the most extravagant one. It tries to extend what the which csh script did to other shells: you can tell it what your aliases and functions are so that it can give you a better answer (and I believe some Linux distributions set some global aliases around that for bash to do that)."
â Jeff Schaller
Jan 31 at 1:20
See also: unix.stackexchange.com/q/322817/117549
â Jeff Schaller
Jan 31 at 1:21
3
that's not a script, it's a shell function.
â cas
Jan 31 at 5:04
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I encounterd the following output while using which
[user@localhost ~]$ which gem
gem ()
I have seen which
show aliases but not bash scripts before.
This script obviously came from RVM but how did it get in to which
and where can I find it on my filesystem? It isn't in .bashrc
.
bash which
I encounterd the following output while using which
[user@localhost ~]$ which gem
gem ()
I have seen which
show aliases but not bash scripts before.
This script obviously came from RVM but how did it get in to which
and where can I find it on my filesystem? It isn't in .bashrc
.
bash which
asked Jan 31 at 0:34
Qwertie
241210
241210
Related: unix.stackexchange.com/a/85250/117549 -- quoting: "There is a GNU which which is probably the most extravagant one. It tries to extend what the which csh script did to other shells: you can tell it what your aliases and functions are so that it can give you a better answer (and I believe some Linux distributions set some global aliases around that for bash to do that)."
â Jeff Schaller
Jan 31 at 1:20
See also: unix.stackexchange.com/q/322817/117549
â Jeff Schaller
Jan 31 at 1:21
3
that's not a script, it's a shell function.
â cas
Jan 31 at 5:04
add a comment |Â
Related: unix.stackexchange.com/a/85250/117549 -- quoting: "There is a GNU which which is probably the most extravagant one. It tries to extend what the which csh script did to other shells: you can tell it what your aliases and functions are so that it can give you a better answer (and I believe some Linux distributions set some global aliases around that for bash to do that)."
â Jeff Schaller
Jan 31 at 1:20
See also: unix.stackexchange.com/q/322817/117549
â Jeff Schaller
Jan 31 at 1:21
3
that's not a script, it's a shell function.
â cas
Jan 31 at 5:04
Related: unix.stackexchange.com/a/85250/117549 -- quoting: "There is a GNU which which is probably the most extravagant one. It tries to extend what the which csh script did to other shells: you can tell it what your aliases and functions are so that it can give you a better answer (and I believe some Linux distributions set some global aliases around that for bash to do that)."
â Jeff Schaller
Jan 31 at 1:20
Related: unix.stackexchange.com/a/85250/117549 -- quoting: "There is a GNU which which is probably the most extravagant one. It tries to extend what the which csh script did to other shells: you can tell it what your aliases and functions are so that it can give you a better answer (and I believe some Linux distributions set some global aliases around that for bash to do that)."
â Jeff Schaller
Jan 31 at 1:20
See also: unix.stackexchange.com/q/322817/117549
â Jeff Schaller
Jan 31 at 1:21
See also: unix.stackexchange.com/q/322817/117549
â Jeff Schaller
Jan 31 at 1:21
3
3
that's not a script, it's a shell function.
â cas
Jan 31 at 5:04
that's not a script, it's a shell function.
â cas
Jan 31 at 5:04
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Try this:
shopt -s extdebug
declare -F gem
From man builtins
:
extdebug
If set, behavior intended for use by debuggers is enabled:
1. The -F option to the declare builtin displays the source file
name and line number corresponding to each function name supâÂÂ
plied as an argument.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Try this:
shopt -s extdebug
declare -F gem
From man builtins
:
extdebug
If set, behavior intended for use by debuggers is enabled:
1. The -F option to the declare builtin displays the source file
name and line number corresponding to each function name supâÂÂ
plied as an argument.
add a comment |Â
up vote
0
down vote
Try this:
shopt -s extdebug
declare -F gem
From man builtins
:
extdebug
If set, behavior intended for use by debuggers is enabled:
1. The -F option to the declare builtin displays the source file
name and line number corresponding to each function name supâÂÂ
plied as an argument.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Try this:
shopt -s extdebug
declare -F gem
From man builtins
:
extdebug
If set, behavior intended for use by debuggers is enabled:
1. The -F option to the declare builtin displays the source file
name and line number corresponding to each function name supâÂÂ
plied as an argument.
Try this:
shopt -s extdebug
declare -F gem
From man builtins
:
extdebug
If set, behavior intended for use by debuggers is enabled:
1. The -F option to the declare builtin displays the source file
name and line number corresponding to each function name supâÂÂ
plied as an argument.
answered Feb 2 at 0:07
m0dular
63115
63115
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f420832%2fwhy-does-gnu-which-show-a-script-instead-of-a-file-path%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Related: unix.stackexchange.com/a/85250/117549 -- quoting: "There is a GNU which which is probably the most extravagant one. It tries to extend what the which csh script did to other shells: you can tell it what your aliases and functions are so that it can give you a better answer (and I believe some Linux distributions set some global aliases around that for bash to do that)."
â Jeff Schaller
Jan 31 at 1:20
See also: unix.stackexchange.com/q/322817/117549
â Jeff Schaller
Jan 31 at 1:21
3
that's not a script, it's a shell function.
â cas
Jan 31 at 5:04