- shell for循环
#!/bin/bash
for num in {0..500..7}; do
echo "${num}"
done
- 常规思路
#!/bin/bash
for num in {0..500}; do
[[ "((num%7))" -eq 0 ]] && echo "${num}"
done
exit 0
#!/bin/bash
for num in {0..500..7}; do
echo "${num}"
done
#!/bin/bash
for num in {0..500}; do
[[ "((num%7))" -eq 0 ]] && echo "${num}"
done
exit 0