I have a command I am trying to alias for simplicity:
php artisan route:list | (head -n 3; grep checkout)
This command shows me the header of this table and searches for the route. The result looks like this:
+--------+----------+--------------------------------------------+----------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+
| 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 |
So this is what I have in my ~/.bash_profile
:
alias findRoute='php artisan route:list | (head -n 3; grep $1)'
But I keep getting this error:
bash: syntax error near unexpected token `checkout'
What gives? Why will it not accept my argument?
I have tried using single and double quotes in the argument I pass.
I have tried using single and double quotes in the alias. Nothing changes.