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

Errors in shell_adv() #808

Open
LadyCailinBot opened this issue Sep 13, 2013 · 2 comments
Open

Errors in shell_adv() #808

LadyCailinBot opened this issue Sep 13, 2013 · 2 comments
Labels
feature request New functionality that doesn't exist yet

Comments

@LadyCailinBot
Copy link

CMDHELPER-2803 - Reported by RobotoRaccoon

Many issues with locating files within directories. These all worked fine in commandline outside of Minecraft.
Was told to submit this in IRC, so apologies for lack of important details, if any.

IOException: Cannot run program "./printSchematics.sh": error=2, No such file or directory
<

>:/data/minecraft/1.5-lobby/plugins/CommandHelper/config.txt:311

shell_adv('./printSchematics.sh')

ShellException: find: >': No such file or directory find: /home/steam/minecraft/SharedServerFiles/Schematics/deliciousfiles.txt': No such file or directory

shell_adv('find . > /home/steam/minecraft/SharedServerFiles/Schematics/deliciousfiles.txt')

And so on in that fashion for attempts like:

shell_adv('ls -1 * >dump.txt')

@LadyCailinBot
Copy link
Author

Comment by LadyCailin

Pipes and things won't work. Those operators are provided by things like bash or the windows terminal, but not the shell() functions. I have no plans on adding that support any time soon either. Instead, you can do something like this (if you're on linux): shell('bash -c "echo hi > test.txt"') which will cause CH to invoke bash, which will in turn execute the given bash script (which does support pipes and other things).

As to your first example, bash has special support for the way ./ works, I will add such support as well, and that will fix the first example, anyways.

@LadyCailinBot
Copy link
Author

Comment by LadyCailin

Ok, after thinking about it some more, I would like to add full support for path expansion, so ./ and ~ should work, however, this will require more research and time, so this feature will be put on the backburner. In the meantime, you can list out the full path to the executable, and that will work, or just always use the bash command to run the commands via bash interpretation. At this point, shell() is still pretty primitive. For instance: shell('bash printSchematics.sh')

@LadyCailin LadyCailin added the feature request New functionality that doesn't exist yet label Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New functionality that doesn't exist yet
Projects
None yet
Development

No branches or pull requests

2 participants