Any number greater than 0 indicates an error. ![]() By convention success is reported by exiting with the number 0. Reporting success and error in a Bash script is accomplished using status codes. cat while-loop-01.shīash while-loop-01.sh Working with status codes x=1 Ĭopy and paste the following code to create and run a Bash script that demonstrates a while loop. The following code uses the less then or equal to symbol -li to run a loop until the counter variable x reaches the number 5. ![]() Easily learn new technologies and coding concepts and quickly find the answers you need.Ī while loop runs continuously until a certain condition is met. With Red Hat Developer cheat sheets, you get essential information right at your fingertips so you can work faster and smarter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |