A
A
akimdi2019-12-05 20:28:53
linux
akimdi, 2019-12-05 20:28:53

How to substitute a variable in an alias to pass a parameter?

In my .zshrc file I wanted to make an alias

alias a2='aria2c --select-file="$1"--input-file="$2"'

But nothing happened. Then I read that you need to make a function
And still nothing came of it.
But when I write directly, everything works, for example:
aria2c --select-file=2 --torrent-file=linux.torrent

Tell me how you can do to substitute the number in the first variable and the path in the second variable. The goal is that after entering the alias, enter a number separated by a space and enter the path in the torrent file. The shell I use is zsh . File in home directory .zshrc

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VSF, 2019-12-06
@Viksf

mb write a script and link to $HOME/bin/a2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question