Skip to main content
3 of 3
added 8 characters in body
posixKing
  • 1.3k
  • 2
  • 13
  • 13

How to create an alias to run a command and exit in bash?

Here is my alias.

alias myAlias='myScript --option& && exit'

I want to run the script myScript with option option in background and then exit from bash. I want to set it up as an alias called myAlias in my bashrc file. However, I am getting an syntax error when I try to run myAlias. How to fix it?

Thanks

posixKing
  • 1.3k
  • 2
  • 13
  • 13