Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Is there a way to use a dash "-" in a CLI script?
When I try to create a field using
im createfield --name=Test --type=shorttext --description="Test - blah blah"
returns an error "MKS124818: No option name or letter was found in "-".
The error goes away when I enter:
im createfield --name=Test --type=shorttext --description="Test blah blah"
Is there a way to embed the character or something?
I quickly tested the command and it did operate as designed (as you verified as well).
When you copy and paste the exact command from the script into another editor or regular file, is it copying all of the text appropriately? By chance are there smart quotes found in the original script? What language is the script written in?
I typed the command into the command line. Original script? I'm simply trying to create a field via the command line and want to use a dash in the description. What Langauge? MKS Integrity 2009.
Is this running in a Linux command shell? If so, which one is it and have you tried a different one? I had seen something similar a couple years ago where commands run on AIX were not accepting dashes in the parameters.
The command shell is Windows.
Hmm that's strange then. I was able to run the same command in my Windows environment against both my 9.7 and 10.5 environments. You should open a case to have PTC Technical Support take a closer look at the weird behavior.
I'm using Integrity 2009. I was hoping one of the PTC Tech reps could weigh in.
Daniel,
Does this occur in a batch script, or just when the command is run on the command line? Are you running this in the Windows command prompt, or do you run a different terminal such as PuTTY?
I run this under Windows command line CMD.
Hello Daniel,
Can you replicate this behavior on other workstations?
In my testing, the only way I have been able to duplicate this behavior is by double-typing or omitting the first quote.
Another test you can do is to see what happens if you move the dash in the quote to after the second word.
A third test you could try would be to use single-quotes instead of double-quotes.
My suspicion is that for some reason the first double-quote is not being processed as a double-quote. Unfortunately, I haven't been able to duplicate the error using the command as you've supplied it, and I've tried it on 2009 SP7, 10.4, and 10.5.
Regards,
Kael
Kael,
I'm not sure what my issue was, but it is no longer a problem. It is possible the workstation I was on was not working well with the Integrity client. Regardless it is no longer an issue. Thank you.