Younus Nabi
Younus Nabi

Reputation: 29

Why this cleartool command fails from a batch file?

I have run the following command from the command line and it has been succesfull

cleartool find . -type f -exec "cleartool describe -fmt \"Filename:%[name]p:type:%[type]p\n" \"%CLEARCASE_PN%"\"" > D:\temp\type.txt

I have tried putting the same command in a batch file but it fails with the follwing output

cleartool: Error: Bad Command line unterminated quoted string
cleartool: Error: Can't exec "(null)": the handle is invalid

Can anyone please show me what the magic line SHOULD look like?
I can stick it into a perl file is that is easier?

I have tried the various suggestions on the site but I have not managed to resolve.

Upvotes: 1

Views: 1286

Answers (1)

VonC
VonC

Reputation: 1330102

You need to double your '%', otherwise it is considered as a 'null' character by DOS:
(And you had some double quotes missing an '\')

cleartool find . -type f -exec "cleartool describe -fmt \"Filename:%%[name]p:type:%%[type]p\n\" \"%%CLEARCASE_PN%%\"" > D:\temp\type.txt

Upvotes: 3

Related Questions