EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB483916: How to avoid using reserved or special characters when connecting to project source from Command Manager through command line execution


Community Admin

• Strategy


This article explains how to resolve the error "-bash: !23: event not found" that appears after executing a Command Manager script containing an exclamation point followed by numbers.

Description


When executing a Command Manager script using the following command:

./mstrcmdmgr -n MSTR -u test -p m$tr!23 -f /home/mstr/MicroStrategy/test.scp 

The error, "
-bash: !23: event not found
" appears in command line.

ka04W000001Iwv2QAC_0EM2R000000nGOr.jpeg

Why is this happening?


Exclamation points are a reserved character by Linux to execute a command from the History List.
So in this example, when passing the exclamation point followed by a number,

!23
, the command line is attempting to write into the entry the 23rd command that was executed during the session.
Linux has several reserved characters that will attempt to resolve to their assigned functions in the command line. Security models tend to require special characters in passwords so you do not accidentally execute a Linux command.

Solution


There are three possible ways to resolve this error: (1) adding single quotations around the password, (2) placing the connection parameters to the project source in the Command Manager script, or (3) using encrypted script files.

Adding Single Quotations


The fastest solution is to wrap the password in single quotations to force the command line to treat the password as a string.
So using the above example, the solution would be add single quotations around

m$tr!23
.
./mstrcmdmgr -n MSTR -u test -p ‘m$tr!23’ -f /home/mstr/MicroStrategy/test.scp  

Adding the Connection Parameters to the Project Source


A more secure solution is to place the connection parameters to the project source within the Command Manager script. This is done through the Connect Source outline in Command Manager:

CONNECT SOURCE "<project_source_name>
" USER "<user_name>
" [PASSWORD "<password>
"];  

ka04W000001Iwv2QAC_0EM2R000000nGOw.jpeg

Executing the script file through the command line execution of Command Manager appears like this:

./mstrcmdmgr -connless -f /home/mstr/MicroStrategy/test.scp

 

Encrypted Script Files


The most secure and recommended way to resolve this error is through encrypted script files. These files provide the best security when passing usernames and passwords.
For step-by-step instructions on creating encrypted script files, see KB38275.


Comment

0 comments

Details

Knowledge Article

Published:

December 20, 2019

Last Updated:

December 20, 2019