1
使用封装命令创建.bashrc函数
我正在尝试创建一个函数.bashrc来快捷我的MAMP命令。我想做这样的事情: mamp config 打开MAMP的httpd.conf文件进行编辑。 mamp restart 重新启动MAMP服务器。 我创建了一个函数.bashrc调用mamp(): function mamp { if [$1 == "config"]; then nano /Applications/MAMP/conf/apache/httpd.conf fi if [$1 == "restart"]; then /Applications/MAMP/Library/bin/apachectl restart fi } 但这似乎不起作用。 我收到这个错误 -bash: [config: command not found