D
D
DollyPapper2017-12-08 00:25:50
linux
DollyPapper, 2017-12-08 00:25:50

Alias ​​with arbitrary argument?

Hello toaster! Such a question: how to create an alias with an arbitrary argument in bashrc? Let's say there is cmd [SOURCE]:[TRAGET] [TEXT]. I want alias cm='cmd [SOURCE]:[TARGET] ......................' . How to create an alias in which there will be these 2 arguments that are already included in the alias + 3 my argument that I will enter when calling?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-12-08
@DollyPapper

um, like this

cm() {
    cmd src:target $1
}

Where $1 is your third parameter and src and target are the first two

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question