Skip to content

Instantly share code, notes, and snippets.

@cjhgo
Last active April 20, 2017 02:27
Show Gist options
  • Save cjhgo/01f6ee2a7d7d55596aee73839120040b to your computer and use it in GitHub Desktop.
Save cjhgo/01f6ee2a7d7d55596aee73839120040b to your computer and use it in GitHub Desktop.
#!/bin/bash
#设置终端目录变量
#usage
#$`kvset nglog /var/log/nginx`
#$cd $nglog
#$pwd
#$/var/log/nginx
if [ $# -eq 0 ]
then
#echo "No arguments supplied"
exit 1
fi
echo "$1=$2">>~/.keyvalue
echo "export $1=$2"
#bashrc source ~/.keyvalue
#.keyvalue要有空白行,
#这样每次echo才会另起一行
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment