问题
I need to concatenate partial content from argv to one of my variable.
I will show you my code:
#!/bin/csh
set stringList = ""
foreach param ($argv)
if($param !~ TEST) then
set stringList = $stringList " " $param
endif
end
echo $stringList > /tmp/prova.txt
Of course, nothing is printed on the txt file. Any solution? Thanks.
回答1:
Change
set stringList = $stringList " " $param
to
set stringList = "$stringList $param"
来源:https://stackoverflow.com/questions/13818067/self-concatenate-strings-on-csh