Is it possible to create a symbolic link to an executable that executes it with a certain option/argument?
I know a workaround would be to create a bash script in one of the PATH directories but can I achieve it somehow with a symbolic link?
EDIT: Thanks for the answers, in my case an alias wouldn't do the job because i'm looking for a way to start matlab from dmenu and at least on arch matlab is only invokable from a terminal at first. Since dmenu does not consider aliases it wouldn't work .. i should have made my problem more clear.
Best Answer
No, a symbolic link is a type of file that references the path of another file.
Now, if you do:
And invoke
foo
as:You'll notice that the first argument that
cat
/foo
received was./foo
and notcat
. So, in a way, through that symlink, we've hadcat
receive a different first argument. That's probably not what you had in mind for your first argument though.Using a shell script wrapper is the typical way to address it. You don't need to use
bash
for that though. Your system's standardsh
will be more than enough for that:Other options include defining an
alias
or function in your~/.bashrc
/~/.zshrc
... for it