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

Special Characters in CUD Argument Strings #163

Open
melrom opened this issue Nov 15, 2013 · 0 comments
Open

Special Characters in CUD Argument Strings #163

melrom opened this issue Nov 15, 2013 · 0 comments

Comments

@melrom
Copy link
Contributor

melrom commented Nov 15, 2013

The way BigJob is currently written, a task description's 'arguments' field is parsed as just a python string.

For example:

        task_desc.executable = ['/bin/echo']
        task_desc.arguments = ['I am task number $TASK_NO','; exec /bin/echo dog' ]

is equivalent on command line:

(python)login1$ /bin/echo 'I am task number 1' ; exec /bin/echo dog
I am task number 1
dog

Because of this, a user must know that is completely a string, in order to put other characters, such as quotation marks, single quotation marks, semicolons, etc. into their arguments.

For example, in python, to print something with quotation marks, I can say:

print ''' "This is something in quotation marks" '''

For an analogous BigJob example, I will illustrate with semicolon.

On command line, I can type:

(python)login1$ /bin/echo '2;1'
2;1

But in BigJob, I can't do this in a way that is immediately apparent to the end-user, because of the way the arguments are just appended strings. So

        task_desc.executable = ['/bin/echo']
        task_desc.arguments = "2;1"

Produces an stdout of 2 and a stderr of "-bash: 1: command not found"

Similarly,

task_desc.arguments = " '2;1' "

has the same result.

In order to actually print 2;1, I need to use triple quotes (akin to what I did above in order to print a string with quotations):

        task_desc.executable = ['/bin/echo']
        task_desc.arguments = ''' "2;1" '''

This will actually print 2;1 (no quotes) to stdout. This is sort of a python nuance, but, the API docs should be very clear that there is no magic with the arguments list - it is just passed to command line as a pythonic string, or we should implement something to operate otherwise in the code. Either solution is fine. This is not a pressing matter. I was just trying to document it for future reference in case any users encounter this issue.

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

1 participant