Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

while loop bash

while true;
do
	#code
done
Comment

shell script while loop example

#!/bin/sh
INPUT_STRING=hello
while [ "$INPUT_STRING" != "bye" ]
do
  echo "Please type something in (bye to quit)"
  read INPUT_STRING
  echo "You typed: $INPUT_STRING"
done
Comment

while loop shell script

#!/bin/sh

a=0

while [ $a -lt 10 ]
do
   echo $a
   a=`expr $a + 1`
done
Comment

bash while loop

#!/bin/bash
i=0
While [ $i -le 10 ]
do
 echo i:$i
 ((i+=1))
done
Comment

for loop while loop shell functions

while check1
do
    # Loop while check1 is successful (returns 0)

    if check1
    then
        echo 'check1 was successful'
    fi

done
Comment

While loops in bash

#!/bin/bash
X=0
while [ $X -le 20 ]
do
	echo $X
	X=$((X+1))
done
Comment

linux while loop shell

while ! [ "${finished}" ]; do
    ...
done
Comment

linux while loop shell

finished=false
while ! $finished; do
    ...
    # At some point
    finished=true
done
Comment

linux while loop shell

while [ "$finished" != "true" ]; do
   ...
done
Comment

PREVIOUS NEXT
Code Example
Shell :: delete git branch remote 
Shell :: ubuntu login as root 
Shell :: how to remove git from a project 
Shell :: git restore all 
Shell :: update git repository 
Shell :: pipenv install flask 
Shell :: Install PHP Plugin ubuntu 
Shell :: ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory 
Shell :: linux blackeye 
Shell :: how to install xdm ubuntu 20.04 
Shell :: git remove file from staging 
Shell :: how to install linux headers on arch 
Shell :: ubuntu set environment variable permanently 
Shell :: linux auto suspensd stop 
Shell :: enzyme npm install 
Shell :: how to install wsl 2 in windows 10 
Shell :: how to download git for mac 
Shell :: get users linux 
Shell :: batch script if statement 
Shell :: echo to file 
Shell :: how to commit single file in git 
Shell :: how to enable bluetooth on terminal 
Shell :: is ubuntu debian 
Shell :: install lando linux 
Shell :: scp with ssh key 
Shell :: linux activate ssh 
Shell :: styled typescript 
Shell :: how to docker login with gitlab 
Shell :: delete git branch from remote 
Shell :: image in github readme 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =