Skip to content

emka.web.id

menulis pengetahuan – merekam peradaban

Menu
  • Home
  • Tutorial
  • Makalah
  • Ke-NU-an
  • Kabar
  • Search
Menu

Belajar Bash: Until Loop

Posted on July 22, 2012

The until loop will continue until a specific requirement is met or  as long as the exit status is NOT zero.  This is the opposite of the while loop.

In the example below you can see that the variable “i” starts with 0 and will loop until it equals 100.  It is incremented by one each loop.  When it reaches 100 it will deliver the zero as an indication of success and the loop will stop.

#!/bin/bash
i=0
until [ $i -eq 100 ]
do
echo $i
i=$(( $i +1 ))
done

Here is the opposite script counting down from 200.  This script counts down until the number is less than 9.  Note that let is used with a negative number.

#!/bin/bash
COUNTER=200
until [  $COUNTER -lt 9 ];
do
echo COUNTER $COUNTER
let COUNTER-=1
done

 

Terbaru

  • Cara Memperbaiki Error Equation/Rumus Jelek di Microsoft Word
  • Cara Mengatasi Adapter Jaringan VMware yang Hilang di Windows 11
  • Cara Reset Multi-Factor Authentication (MFA) di Microsoft Entra
  • Cara Mengatasi Masalah Konektivitas VM Hyper-V ke Host
  • Cara Memperbaiki Error 0x8000FFFF Catastrophic Failure Saat Ekstrak Zip
  • Cara Memperbaiki File Explorer Crash Saat Membuka Folder Besar di Windows 11/10
  • Cara Mengatasi Error Login 0x8007003B di Outlook, Microsoft, XBox dll
  • Cara Memulihkan Akun Admin Microsoft 365 Karena MFA Gagal
  • Cara Mengatasi Error “A Conexant audio device could not be found”
  • Cara Memperbaiki Windows Tidak Nyala Lagi Setelah Sleep/Locked
  • Cara Memperbaiki Komputer Crash karena Discord
  • Cara Memperbaiki Error Windows “Failed to update the system registry”
  • Cara Memperaiki LGPO/exe/g
  • Cara Memperbaiki Error Tidak bisa Add Calendar di Outlook
  • Cara Memperbaiki File Transfer Drop ke 0 di Windows 11
  • Cara Memperbaiki Microsoft Copilot Error di Outlook
  • Cara Memperbaiki Error Virtualbox NtCreateFile(\Device\VBoxDrvStub) failed, Not signed with the build certificate
  • Cara Memperbaiki Error “the system detected an address conflict for an IP address, with Event ID 4199”
  • Cara Memperbaiki Password Microsoft Edge yang Hilang
  • Cara Memperbaiki Email Outlook yang Hilang atau Tidak Muncul
  • Cara Menemukan Username dan Password di Windows 11
  • Cara Mengatasi Error Virtualbox not detecting Graphics Card di Windows 11
  • Cara Mengatasi Error Windows MFReadWrite.dll not found or missing
  • Cara Membuat Formulir Menggunakan Zoho Form
  • Pemerintah Ganti Ujian Kesetaraan Dengan TKA 2025
  • Ini Perbedaan TKA vs Ujian Nasional: TKA Lebih Sakti?
  • Daftar TKA Tutup 5 Oktober: Sudah 3.3 Juta Yang Daftar
  • Review Aplikasi ClipClaps: Penipuan atau Tidak?
  • Review Aplikasi Wibuku: Alternatif Nonton Anime Gratis untuk Para Wibu Indonesia!
  • Inilah Alat dan Software Phone Farming dengan Samsung Galaxy J7 Prime
  • Cara Memperbaiki Error Equation/Rumus Jelek di Microsoft Word
  • Cara Mengatasi Adapter Jaringan VMware yang Hilang di Windows 11
  • Cara Reset Multi-Factor Authentication (MFA) di Microsoft Entra

©2025 emka.web.id | Design: Newspaperly WordPress Theme