in reply to How to convert arguments to string

The "&" characters are most likely being interpreted by the shell (this is on a *nix system, right?) as the "background" operator. That is, if you are not enclosing the string in single quotes on the command line, the shell thinks you wish to run those "commands" in the background.

Try using double (or single) quotes around the argument on the command line and see what happens. I.e:

$myprog 'http://sampleurl.sample.com/DOCID=1234&DOCREV=1&DOCLOC=1234&D +OCDIAL=~'
It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^2: How to convert arguments to string
by soonix (Chancellor) on Nov 20, 2013 at 07:05 UTC

    The message text 'DOCLOC' is not recognized as an internal or external command, operable program or batch file. is typical for a DOS/Windows based System.
    *nix would ask an astonished but terse: DOCLOC?
    :-)

    Of course, the result is similiar, "&" in DOS/Win is like ";" in *nix

Re^2: How to convert arguments to string
by fearthechris29 (Initiate) on Nov 20, 2013 at 07:05 UTC

    Wow! That works! Thanks Monks!