ruby for loop
for i in 0..2 do
print(i)
end
# => 0
# => 1
# => 2for element in array do
element.do_stuff
endwhile $i < $num do
puts("Inside the loop i = #$i" )
$i +=1
end#!/usr/bin/ruby
$i = 0
$num = 5
while $i < $num do
puts("Inside the loop i = #$i" )
$i +=1
end
# outputs
# Inside the loop i = 0
# Inside the loop i = 1
# Inside the loop i = 2
# Inside the loop i = 3
# Inside the loop i = 4
Also in Shell:
- git basic command tutorial
- linux vim set tab to 4 spaces
- php apache "You do not have permission to use at.
- git pull hard
- install react bootstrap
- react-devtools agent got no connection
- linux screen detach
- linux set environment
- grep
- sed replace in file
- git delete branch
- how to delete all branches in git except master
- unarchive tar acrhive
- installing rspec gemfile
- git merge branch to master
- git file history
- shell file in linux
- android studio kvm is required to run this avd
- install jquery npm
- install requirements.txt
- npm list global packages
- bash create file
- commit the add complete folder to github
- bash call another script relative to current script