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

Some commands fail to run #19

Open
DPini opened this issue Oct 27, 2016 · 3 comments
Open

Some commands fail to run #19

DPini opened this issue Oct 27, 2016 · 3 comments

Comments

@DPini
Copy link
Contributor

DPini commented Oct 27, 2016

If you try to run commands with " and &, it fails because it's not parsed correctly when running the command in command-executer.

Example:
echo " echo "asd" & echo "dsa" "

From wibed-node executes:
echo "108 echo " echo "asd" & echo "dsa" "" > "/var/run/command-executer.sock"

That makes that in the pipe, you only get dsa. So it fails

@DPini
Copy link
Contributor Author

DPini commented Oct 27, 2016

commandStr = string.gsub( commandStr, '"', '"')
in /usr/sbin/wibed-node ( function executeCommands ) may be a solution.

Needs testing

@HRogge
Copy link

HRogge commented Oct 28, 2016

On Thu, Oct 27, 2016 at 6:44 PM, DPini notifications@github.com wrote:

If you try to run commands with " and &, it fails because it's not parsed
correctly when running the command in command-executer.

Example:
echo " echo "asd" & echo "dsa" "

I don't think this line should work at all... you have two levels of
quotation marks mixed up... and (I think) you mixed up "&" and "&&".

Henning Rogge

From wibed-node executes:
echo "108 echo " echo "asd" & echo "dsa" "" >
"/var/run/command-executer.sock"

That makes that in the pipe, you only get dsa. So it fails


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#19, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AG8YtwjHSaCshbrwciOKNxfFV8lekM73ks5q4NUKgaJpZM4Kik46
.

@DPini
Copy link
Contributor Author

DPini commented Nov 3, 2016

I was trying to have the same result as running the commands in a sh shell in a local machine.
I know that this ampersand is not && (and ), for running multiple commands. I was trying to see how the system "parses" it.
Example of correct execution:
sh-4.3$ echo " echo "asd" & echo "dsa" "
echo asd & echo dsa

I used this command so it seem to be corner case, I was trying to found commands that fail to "improve" that.

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

2 participants