New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type: add example #12668
type: add example #12668
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks for your contribution.
Quick question. Thanks |
Looks like it works in bash only. In OSX, your default shell is most likely zsh. I will add a note to the example. Thanks for reporting this. |
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution, LGTM after my suggestion
Co-authored-by: Vítor Henrique <87824454+vitorhcl@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fazlearefin could you add the same note (Bash note) in the other examples, please? The POSIX has no options.
LGTM after this fix.
@vitorhcl The other examples do no need the note as they work in both Bash and Zsh. The new example I added works in Bash only. Here are some screendumps: Zsh pop-os# ps -p $$
PID TTY TIME CMD
1726216 pts/9 00:00:00 zsh
pop-os#
pop-os# zsh --version
zsh 5.8.1 (x86_64-ubuntu-linux-gnu)
pop-os#
pop-os# type ls
ls is /usr/bin/ls
pop-os#
pop-os# type -a ls
ls is /usr/bin/ls
ls is /bin/ls
pop-os#
pop-os# type -p ls
ls is /usr/bin/ls
pop-os#
pop-os# type -t ls
type: bad option: -t
pop-os#
pop-os# Bash pop-os:~$ ps -p $$
PID TTY TIME CMD
1790148 pts/11 00:00:00 bash
pop-os:~$
pop-os:~$ bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
pop-os:~$
pop-os:~$ type ls
ls is /usr/bin/ls
pop-os:~$
pop-os:~$ type -a ls
ls is /usr/bin/ls
ls is /bin/ls
pop-os:~$
pop-os:~$ type -p ls
/usr/bin/ls
pop-os:~$
pop-os:~$ type -t ls
file
pop-os:~$ |
Thank you for showing me this. Anyways, could you please add a note on these examples that only work on Bash and Zsh? I've consulted the documentation of all BSDs and all their default shells strictly follow the POSIX standard for the |
Adding the note to all examples is too repetitive IMO. How about adding a note at the top of the page saying these commands work in Bash, Fish and Zsh shells only (BTW I tried in Fish shell and all of them worked)? |
Let's just be sure to make clear, even if implicitly, that POSIX only supports the no options example. |
Done. |
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
common
,linux
,osx
,windows
,sunos
,android
, etc.