Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

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 $@ & }
share|improve this answer
add comment
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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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