为简单起见,我有一个命令要别名:
php artisan route:list | (head -n 3; grep checkout)
此命令显示此表的标题并搜索路由。结果如下所示:
+--------+----------+--------------------------------------------+----------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+---------------------------------------------+----------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+
| | POST | profile/auctions/checkout | user-portal-profile-auctions-checkout | xxxxxxxxxxxxxxxx | web,auth |
| | POST | profile/deals/checkout | user-portal-profile-deals-checkout | xxxxxxxxxxxxxx | web,auth |
| | POST | profile/quotes/checkout | user-portal-profile-quotes-checkout | xxxxxxxxxxxxxxx | web,auth |
所以这就是我的~/.bash_profile
:
alias findRoute='php artisan route:list | (head -n 3; grep $1)'
但我不断收到此错误:
bash: syntax error near unexpected token `checkout'
是什么赋予了?为什么它不接受我的论点?
我尝试在传递的参数中使用单引号和双引号。
我尝试在别名中使用单引号和双引号。没有什么变化。