0

Hi I was trying to create an alias to run a shell script in background:
alias inj=nohup ~/software/idea-IU/bin/idea.sh in my ~/.bashrc
But as I type inj in terminal, I got nohup: missing operand error.
I verified that it works fine if I directly call nohup ~/software/idea-IU/bin/idea.sh in terminal but it just doesn't work when it's in alias.
So is there some other tricks that I'm not aware of that's causing this?

wayne
  • 101
  • 2
    Pass it as single string - so quote it: alias inj='nohup ~/software/idea-IU/bin/idea.sh' – muru Jun 09 '22 at 00:29
  • imo, your example should be a function, not an alias, inj(){ nohup ~/software/idea-IU/bin/idea.sh; }. With an alias you can add arguments, but you don't seem to need that here. – pLumo Jun 09 '22 at 05:21

0 Answers0