Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Don_Paterson
Advisor

MDS prompt change to reflect mdsenv

Can the command prompt on an MDS be set to automatically change based on the MDS environment, mdsenv, and show the DMS name (or part of) or the IP?

 

0 Kudos
6 Replies
HeikoAnkenbrand
Champion Champion
Champion

Set the promt message with:

export PS1=

 

➜ CCSM Elite, CCME, CCTE
0 Kudos
Don_Paterson
Advisor

That's not really helpful, but thank you.

0 Kudos
HeikoAnkenbrand
Champion Champion
Champion

Don't have MDM right now. May be that this must be a[3] or a[5].

export PS1="\h / $(echo $FWDIR | awk '{split($0,a,"/"); print a[5]}') #"

 

➜ CCSM Elite, CCME, CCTE
0 Kudos
HeikoAnkenbrand
Champion Champion
Champion

If you copy this to the following file ".bashrc" in your home directory, it is permanent.

 

.bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
PS1="\h / $(echo $FWDIR | awk '{split($0,a,"/"); print a[5]}') #"

 

➜ CCSM Elite, CCME, CCTE
0 Kudos
Don_Paterson
Advisor

Thanks. I will try that too, but so far the space between = and " is a problem and the result is just the hostname # and no change when moving between DMS environments (mdsenv).
The ideal would be for Check Point R&D to make the prompt change in a similar way to the way vsenv changes the number in the prompt to show the context/VSID number.

Appreciate the feedback. Will look into it more tomorrow.

0 Kudos
HeikoAnkenbrand
Champion Champion
Champion

Hi @Don_Paterson,

Have tested it  in the LAB with a MDS!

export PS1="\h / $(echo $FWDIR | awk '{split($0,a,"/"); print a[5]}') #"

Now the prompt looks like this:
prompt_345345345.png

 

For the rest you can still adjust.

 

➜ CCSM Elite, CCME, CCTE

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events