I have a following code:
function test() {
for ft in "$1"; do
echo $ft
done
}
test 5
I am trying to loop through number 12, therefore I want ft to be 1,2,3,4,5
respectively in each loop. But it is just printing 5. I also tried {1..$1}
but result is still same. Please help!
5
(not12
). It's unclear what it is you are actually wanting to do. How is the sequence1,2,3,4,5
related to12
? – Kusalananda Nov 30 '19 at 16:14