Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Printing 1-100 in Bash (3 ways)

i=1
while [ $i -le 100 ]
do
    echo $i
    i=$(($i+1))
done

//OR

i=1
while [ $i -le 100 ]
do
    echo $i
    i=`expr $i + 1`
done

//OR

for((i=1;i<=100;i++))
do
    echo $i
done
Comment

PREVIOUS NEXT
Code Example
Shell :: install qemu-img 
Shell :: nginx: invalid option: "restart" 
Shell :: add user to group 
Shell :: change default editor linux 
Shell :: install the latest docker on ubuntu 20.04 
Shell :: operator mono github 
Shell :: find program path linux 
Shell :: find text in files ubuntu 
Shell :: uninstall gitlab-ee 
Shell :: git fix Large files detected. 
Shell :: first in list bash 
Shell :: gitignore for django project 
Shell :: rust install windows 
Shell :: "C:UsersMY PCAppDataRoaming pm/node_modules/node/bin/node: line 1: This: command not found" 
Shell :: How to Enable-Migrations? 
Shell :: proc folder 
Shell :: git search all branches 
Shell :: conda install sklearn 0.20 
Shell :: ubuntu kill process 
Shell :: react native run android shows deprecated items 
Shell :: bash: tree: command not found... centos7 
Shell :: install ionic cli specific version 
Shell :: rustup set default toolchain nightly 
Shell :: retroarch for ubuntu 
Shell :: snap list installed 
Shell :: connect to specific wifi decive linux 
Shell :: how to exit telnet linux 
Shell :: Setfacl 
Shell :: set root password kali 
Shell :: trusted installer owner 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =