Get the App
SLTechnology News&Howtos  ›  Servers  › 

Carding the basic knowledge of shell script & lt; VI & gt;: process Control while Loop statement

Shulou Source: shulou.com Published: 2022-06-03 03:05:33 09月22日 Update

While syntax format

While test condition

Do

Instruction

Done

The while loop can be used to read keyboard information. In the following example, the input information is set to the variable FILM and press to end the loop.

Echo 'Press to exit'

Echo-n 'enter the name of your favorite website:'

While read FILM

Do

Echo "Yes! $FILM is a good website"

Done

#! / bin/bash

Int=1

While ($int

Tags: Instance result loop information variable format website grammar input example instruction yes condition environment system site name keyboard random number face test Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Redmi Huawei MariaDB Xiaomi