Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the continue command of linux to end this cycle

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the use of linux continue command to end this cycle, the article is very detailed, has a certain reference value, interested friends must read it!

The main purpose of continue is to end this loop and continue with the next for,while or until loop; you can specify which layer of the loop to continue.

Syntax format: continue

Common parameters:

Reference example

The default value of the optional parameter n for continue is 1:

For ((iposit I > 0 poster imuri -)); do for ((job3umbj > 0 posit j -); do if ((jobless 2)); then continue fi printf "% s% s\ n" ${I} ${j} done done # output result 3 3 3 1 2 3 2 1 1 1

When n is 2: jump to the outer for loop to continue execution:

For ((iposit I > 0 poster iMurb -)); do for ((Job310 j > 0 positjmure -)); do if ((jogwash 2)); then continue 2 fi printf "% s% s\ n" ${I} ${j} donedone # output result 3 3 2 3 1 3 or above is to use the linux continue command to end this cycle, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report