Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ksh scripting, For loop

Tags:

ksh

#!/bin/ksh
#########################     
for i in {1..30} ;do
  echo $i
done

output is:

{1..30}  

What is wrong in my code?

like image 586
Ilya Avatar asked Apr 02 '12 13:04

Ilya


1 Answers

{1..30} belongs to bash.

Use this:

for((i=1;i<=30;i++)); do
    echo $i
done
like image 70
kev Avatar answered Sep 28 '22 13:09

kev