I want to make alias to open file with GUI editor on background from command line.
I tried:
alias new_command="editor_path &"
new_command file
But it just open editor without loading the file.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The & is ending the command, so it is not seeing your file argument. You can’t use alias if you want to substitute the filename string into the command with the ampersand on the end.
From the bash manpage:
Consider creating a shell function: