I wish to append & sign to the end of particular command (say tkdiff) whenenver I execute the command.

Please let me know what kind of alias / any other solution should I create in bashrc.

Thanks in advance.

Note: I may have few arguments to the command which i execute. & should come at the end so that I can execute in b/g and I can use the shell for any other purpose.

link|improve this question

29% accept rate
feedback

2 Answers

You can't do this with a simple alias because the shell interprets the $@ when you define the alias. I would do this with a function in my .bashrc

tkdiff () { /usr/bin/tkdiff $@ & }
link|improve this answer
feedback
alias tkdiff='tkdiff &'

then source the .bashrc file to have it re-read and try again

edit: ok, I missed (or you added) the part about the extra arguments. You could try using $@ which is the variable holding the arguments list passed to the shell, but I have not tested this, sorry.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.