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

Can not run the export utility when partially quoted #2224

Open
9ao9ai9ar opened this issue Jan 6, 2025 · 3 comments
Open

Can not run the export utility when partially quoted #2224

9ao9ai9ar opened this issue Jan 6, 2025 · 3 comments

Comments

@9ao9ai9ar
Copy link

osh-0.23.0$ \export -p
  \export -p
  ^~
[ interactive ]:1: Can't run assignment builtin recursively
osh-0.23.0$ export'' PATH
  export'' PATH
  ^~~~~~
[ interactive ]:2: Can't run assignment builtin recursively
osh-0.23.0$ 'export' -p SHELL
declare -x SHELL=/bin/bash
@andychu
Copy link
Contributor

andychu commented Jan 12, 2025

This is likely to be low priority unless/until it shows up in a real script

I think we have seen other instances of this problem -- it's been discussed on Zulip

@9ao9ai9ar
Copy link
Author

It used to show up in my personal scripts, but I have reordered the line after unalias -a so the quoting is not needed anymore (even if I have to, I could just quote the whole name, which is a trivial workaround).

@andychu
Copy link
Contributor

andychu commented Jan 13, 2025

OK I'd be interested to see the script

We may relax this, so having some real test cases can help

IIRC the reason it's like this is that assignment builtins like export declare etc. have special parsing rules

especially when you combine that with arrays in bash, you will get weird results

e.g. I think it may be related to builtin declare x=string and builtin declare x=(array val) - the latter is not consistent

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

No branches or pull requests

2 participants