Skip to main content

Timeline for Print numbers from 1-50

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Dec 8, 2014 at 12:41 comment added HalosGhost @muru, possible though that may be, I remain unconvinced that looping signals wrong-doing in shell. Additionally, I already said I typically prefer a foreach-style loop in most of those cases (which is often not strict iteration).
Dec 8, 2014 at 12:39 comment added muru @HalosGhost Perhaps Stephane prefers recursion to iteration. :)
Dec 8, 2014 at 12:36 comment added HalosGhost Stéphane, I would only argue with you that there are plenty of times to use loops in bash. Looping is a basic programming construct, and is even applicable in shells (though admittedly, it makes more sense to use a foreach loop in most of those cases).
Dec 8, 2014 at 12:21 comment added phemmer @SF. If you want shell, seq is hardly the 'right' way. echo {1..50} (or printf) would arguably be the shell way.
Dec 8, 2014 at 12:17 comment added SF. The beauty of Shell is that there are commands to do most things that are commonly useful but hard to implement. In this case, seq 50 is the one correct answer to OP's question: THIS is how you print numbers 1-50 in shell.
Dec 8, 2014 at 12:09 history answered Stéphane Chazelas CC BY-SA 3.0