$ perl -e 'print "$_\n" for (1..10);'
— by abhinickz6
on May 30, 2017, 2:47 p.m.
Print the number with newline character which could be replaced by any char.
$ for ((i=1; i<=10; ++i)); do echo $i; done
— by Janos
on Nov. 4, 2014, 12:29 p.m.
This is similar to seq, but portable. seq does not exist in all systems and is not recommended today anymore. Other variations to emulate various uses with seq:
# seq 1 2 10
for ((i=1; i<=10; i+=2)); do echo $i; done
# seq -w 5 10
for ((i=5; i<=10; ++i)); do printf '%02d\n' $i; done