When I try to combine two normal commands using the
; character (eg.
ls; cd) it works fine. However, I have two aliases that I've created (
startdev), and if I try to combine them:
or even if I just try and add a semi-colon after one:
I get a syntax error:
bash: syntax error near unexpected token `;'
I also have the same problem if I use
stopdev && startdev
bash: syntax error near unexpected token `&&'
I'm confused by this because I had thought that aliases were just like any other commands ... but clearly they aren't.
So, two questions:
- Why is using
&&with an alias call invalid?
- Is there any way (other than creating a
stopstartdevalias) to easily run these two commands together?
Here's the definition of
alias stopdev="cd $HOME/website; make website_stop; make backend_stop;"