开发者

How to print arguments passed to configure script?

开发者 https://www.devze.com 2023-01-01 02:25 出处:网络
I\'m trying to print arguments passed to a ./configure script. Calling \'echo\' on $BASH_ARGV will just print the last set of arguments.开发者_运维问答 For example if I run:

I'm trying to print arguments passed to a ./configure script. Calling 'echo' on $BASH_ARGV will just print the last set of arguments.开发者_运维问答 For example if I run:

./configure --enable-foo --enable-bar

echo $BASH_ARGV will print only "--enable-bar"

How do I print all the arguments? Thanks!


You can use $@ and $* to refer to parameters.

echo "$@"; should do it. A little more information here


There is a variable called ac_configure_args that contains what I need. Thanks for the help everyone.


Since it's an array, you need to do this to get all the elements:

echo ${BASH_ARGV[@]}

or use a loop to iterate over them.

Note: they'll be output in reverse order.

0

精彩评论

暂无评论...
验证码 换一张
取 消