开发者

when i try to echo $10 it becomes echo $1 0 [duplicate]

开发者 https://www.devze.com 2023-03-08 12:41 出处:网络
This question already has answers here: 开发者_开发问答 How to handle more than 10 parameters in shell
This question already has answers here: 开发者_开发问答 How to handle more than 10 parameters in shell (2 answers) Closed 2 years ago.

given something like this

find -type f -newermt "2011-05-26 15:40:35.088712" | xargs -n 1 bash -c fn=$0; set -- `ls -l $fn`; echo $7 $8 $9 $10;

I expect it to output the content in $10 when i try to echo $10 what really happens is it echos $1 along with 0, how do i make it echo $(10)


You need to use echo ${10} to make that work.

0

精彩评论

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