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

Avoid requiring . when running paths #44

Closed
refi64 opened this issue Mar 18, 2018 · 3 comments
Closed

Avoid requiring . when running paths #44

refi64 opened this issue Mar 18, 2018 · 3 comments

Comments

@refi64
Copy link

refi64 commented Mar 18, 2018

The title probably doesn't make much sense, so here's an example:

$ path/app

This works in bash, but it doesn't in rc unless . is in $path. I understand why this would be useful, but it can be really irritating, too. I'm using rc as the scripting language in my project IsolateKit, and this would be a really nice addition!

@xyb3rt
Copy link
Collaborator

xyb3rt commented Mar 18, 2018

Whats wrong with $ ./path/app?

@TobyGoodwin
Copy link
Contributor

Interesting project, and delighted that you're using rc!

But I don't think there's anything to fix here. In rc: if a command starts with / it's absolute, otherwise we search $path. That's a simpler rule than sh, which I think is: if it start with / it's absolute, if it contains / it's relative to the cwd, otherwise we search $PATH.

This was used in Plan 9, as I understand it, to implement subcommands. In the Linux world, git is a wrapper, but in the Plan 9 world (had it existed there) it would simply be a directory /bin/git/ and you'd say git/commit ... etc etc

@rakitzis
Copy link
Owner

NB: "asbolute" pathnames may also start with ./ and ../

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

4 participants