I am SSH'd into an embedded board (Jetson TK1 running Ubuntu 14.04). I use the -X option so I can use gedit to edit text files. When executed from a terminal, gedit spews a bunch of garbage on the terminal. This is easy to get around by typing
gedit [file] > /dev/null 2>&1 &
with the last ampersand sending the process to the background so I can keep using the terminal. That gets tiresome to type out everytime so I want to define an alias:
alias gedit="gedit $@ > /dev/null 2>&1 &"
however this doesn't work. After the alias is defined (and for the initial try I just defined it directly on the bash command line), when typing
Bash responds that
-bash: [file]: command not found
and opens gedit with with an untitled text file. Removing the trailing ampersand in the alias definition makes the alias open the specified file as expected, but now obviously doesn't send gedit to the background. What's wrong?