1

I wonder if there is possible to access full command line call in shell script. In my script I need to pass it further. I find that there are $@ and $* accessors, but it do not pass all the characters, for example if I write in command line: $ my_script xyz -m "something here" and in my script I access command line arguments as follows:

arguments="$*"

echo $arguments

I will see output: xyz -m something here. It unfortunately removed quotes, is there possible to keep them? Then I want to pass these arguments to another script, I do not know how many of them will be, and at which position in line I will have quotes.

2

I actually solve my problem, before, in my first script I fire second script like I wrote above, but actually in my first script I should use:

second_script "$@"

To fire second script, now it works as expected. Relevant are quotes around $@.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.