Linux 将一个变量用作另一个变量名称的一部分

Linux 将一个变量用作另一个变量名称的一部分,linux,bash,shell,unix,Linux,Bash,Shell,Unix,猛击问题 所以我有n个参数,对于每个参数,我想做一个for循环,并分配变量来保存每个参数的特征。例如,我有一个脚本,它在一个连续的while循环中运行,并查看网络中的用户活动。。。这是我的问题的简单概述: while true for argument do # build an array to hold times "$user"_times =() # set a boolean value "$user"_boolean=true if [ ""$user"_boolea

猛击问题

所以我有n个参数,对于每个参数,我想做一个for循环,并分配变量来保存每个参数的特征。例如,我有一个脚本,它在一个连续的while循环中运行,并查看网络中的用户活动。。。这是我的问题的简单概述:

while true

for argument
do 
# build an array to hold times
"$user"_times =()
# set a boolean value
"$user"_boolean=true

     if [ ""$user"_boolean" = true ]
     then
     echo $user logged on 
     "$user"_times+=( timestamp )
     fi
 done 
done
exit 0

真正的脚本将查看用户活动,根据特定的用户行为更新布尔值,并在数组中记录一些用户活动信息-但我正在尝试使其正常工作,以便添加easy meat。语法应该是什么?我很难让变量起作用