'How to run loop of bash script

I'm new to Bash scripts.

I have this script

@echo off&&powershell -NoE -c "&{ipmo activedirectory; set-adaccountpassword (read-host 'user') -R}"

this script is running connecting to AD and then it's asking for the user and then I can reset a password for the user that I will type and then the script ends.

can someone help to do run this screen in a loop until I will type "done"?

thnaks



Solution 1:[1]

Loop are design to run repetitive tasks. To have interrupt from the user you may create do while loop and try to keep a condition check on while statement with your done condition. Check this question and posted answer for do while concept emulating-a-do-while-loop-in-bash

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kashif