cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Using a dash "-" in cli script

DanR.
10-Marble

Using a dash "-" in cli script

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?

10 REPLIES 10
wspadola
7-Bedrock
(To:DanR.)

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?

DanR.
10-Marble
(To:wspadola)

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.

JoeBartlett
21-Topaz I
(To:DanR.)

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.

JoeBartlett
21-Topaz I
(To:DanR.)

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?

DanR.
10-Marble
(To:jgorsline)

I run this under Windows command line CMD.

KaelLizak
14-Alexandrite
(To:DanR.)

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


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
DanR.
10-Marble
(To:KaelLizak)

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.

Top Tags