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?
Asked
Active
Viewed 23 times
0
wayne
- 101
- 1
-
2Pass 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