I am trying to create a simple alias that uses the argument with the full path
On the command line, I can type command "$(pwd)/my_file". It works. so I tried to create an alias in the following way:
alias command='command "$(pwd)/$1"'
This alias didn't work though. The CLI interprets as if $(pwd) and my_file were separated arguments... I tried to use the eval command to turn my command into a single one
alias command="eval 'command' '$(pwd)/$1'"
However, it keeps waiting for an input argument instead of taking my initial argument...
If you wanna try out what I mean, substitute command for the evince (a popular PDF viewer) and my_file for any PDF file. So my alias is
alias evince="evince $(pwd)/$1"
In my case, $(pwd) is /home/tapyu/Downloads/, and my_file is recap.pdf. I know that evince is treating it as a separated argument because it pops up two windows: The first one opens recap.pdf properly. The second is an empty window with a warning "Error opening file, /home/tapyu/Downloads/ is a directory."
Thank you in advance.
PS: I know that this "problem" is pointless. My problem is not "how to give the full path to a command", my problem is "how to handle inputs argument in an alias in order to solve this kind of situation". So don't wanna alternatives to give the full path, I wanna know why my alias is not working.