A
A
Alex2016-11-15 13:07:25
bash
Alex, 2016-11-15 13:07:25

How to pass all parameters in BASH to an internal call?

Hello. The point is the following.
I have a file ./start.shthat conditionally serves to make it easier to run a longer command

/usr/local/lib/path/to/lib/bin /home/user/path/to/some/file
. So. There was a need to pass several parameters to the internal call.
I want all parameters during the call to be
./start.sh --max=100
transferred to the internal call
/usr/local/lib/path/to/lib/bin /home/user/path/to/some/file --max=100

How to implement the transfer of all parameters to an internal call?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2016-11-15
@Kozack

Pass as "$*" or "[email protected]"

./start.sh
/usr/local/lib/path/to/lib/bin /home/user/path/to/some/file [email protected]

But in your case with a one-line command, it's easier to make an alias
and call:
STARTSH --max=100
The only thing is to put this alias in .profile or .bashrc so that it is available immediately upon login.
autocomplete works with aliases, so ST+tab is enough

S
strelmax, 2016-11-15
@strelmax

internal call do this
/usr/local/lib/path/to/lib/bin /home/user/path/to/some/file $1
and you can set the parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question