[root@host-172-16-13-179 ~]# cat /root/.mongorc.js
host=db.serverStatus().host;
cmdCount=1;
prompt=function(){
return db+"@"+host+" "+(cmdCount++) +">";
}
function showDate(){
var today = new Date();
var year = today.getFullYear() + "年";
var month = (today.getMonth() +1) + "月";
var date = today.getDate() + "日";
var quarter = "一年中的第" + Math.floor((today.getMonth() +3) / 3) + "个季度";
var text = "欢迎回来,今天是" + year + month + date + "," + quarter + "。";
print(text);
}
showDate();
标签:shell,mongodb,month,host,cmdCount,设置,text,var,today From: https://www.cnblogs.com/hmysql/p/17005250.html