Skip to content
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

shell equivalents for justpath commands #15

Open
epogrebnyak opened this issue Feb 29, 2024 · 8 comments
Open

shell equivalents for justpath commands #15

epogrebnyak opened this issue Feb 29, 2024 · 8 comments

Comments

@epogrebnyak
Copy link
Owner

Justpath would print what shell command you can do instead.

Easy for simple commands, less obvious for bigger commamds. Also a lot of comments this is trivial in bash.

Maybe start with just one flag --shell and then add --bash, --zsh or --cmd

@epogrebnyak
Copy link
Owner Author

Wonder why I get this output:

     1 /home/codespace/.local/bin
     1 /home/codespace/.local/bin

for echo $PATH | tr ":" "\n" | uniq -c as there isclearly a duplicate folder

@epogrebnyak
Copy link
Owner Author

After sorting uniq does see the duplicates:

@epogrebnyak ➜ /workspaces/what-the-path (main) $ echo $PATH | tr ":" "\n" | sort | uniq -dc
      2 /home/codespace/.local/bin
@epogrebnyak ➜ /workspaces/what-the-path (main) $ echo $PATH | tr ":" "\n" |  uniq -dc

@epogrebnyak
Copy link
Owner Author

@epogrebnyak ➜ /workspaces/what-the-path (main) $ echo $PATH | tr ":" "\n" | nl | head -n12
     1  /usr/local/rvm/gems/ruby-3.2.2/bin
     2  /usr/local/rvm/gems/ruby-3.2.2@global/bin
     3  /usr/local/rvm/rubies/ruby-3.2.2/bin
     4  /vscode/bin/linux-x64/8b3775030ed1a69b13e4f4c628c612102e30a681/bin/remote-cli
     5  /home/codespace/.local/bin
     6  /home/codespace/.dotnet
     7  /home/codespace/nvm/current/bin
     8  /home/codespace/.php/current/bin
     9  /home/codespace/.python/current/bin
    10  /home/codespace/java/current/bin
    11  /home/codespace/.ruby/current/bin
    12  /home/codespace/.local/bin

@epogrebnyak
Copy link
Owner Author

@epogrebnyak epogrebnyak changed the title --shell equivalents for justpath commands shell equivalents for justpath commands Mar 3, 2024
@epogrebnyak
Copy link
Owner Author

Maybe the flag should be called --recepies or --cookbook - easier to type.

@epogrebnyak
Copy link
Owner Author

How to Follow Symbolic Links in Linux
https://linuxhandbook.com/follow-symbolic-link/

@epogrebnyak
Copy link
Owner Author

justpath --bare | grep -v -e usr -e home | xargs -l1 realpath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant