List 如何将项目附加到csh列表中?

List 如何将项目附加到csh列表中?,list,csh,List,Csh,我想创建一个列表,其中包含应用于某些 csh中的条件 如何以动态方式添加到列表或数组中,而不预先确定 列表或数组的大小 在c shell中是否有list.add或类似的内容 谢谢您可以使用设置我的列表=($my\u list more)的形式。例如: # Create original list % set my_list = ( hello world ) % echo $my_list hello world # Append to the list % set my_list = ( $

我想创建一个列表,其中包含应用于某些 csh中的条件

如何以动态方式添加到列表或数组中,而不预先确定 列表或数组的大小

在c shell中是否有list.add或类似的内容


谢谢

您可以使用
设置我的列表=($my\u list more)
的形式。例如:

# Create original list
% set my_list = ( hello world )
% echo $my_list
hello world

# Append to the list
% set my_list = ( $my_list hey there )
% echo $my_list
hello world hey there

# Loop over the list to verify it does what we expect it to do
% foreach item ($my_list)
foreach? echo "-> $item"
foreach? end
-> hello
-> world
-> hey
-> there
使用“set my_list=($my_list:q more)”避免空格问题: