脚本:

#!/bin/bash

for i in I am the a hero and you must to learning py
do
    if [ `expr length $i` -le 6 ]
        then 
            echo $i
    fi
done
 

执行结果:

 Shell——expr应用案例:打印下面字符串中字符数不大于6的单词

相关文章:

  • 2021-07-05
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-10
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-08-30
  • 2021-09-21
  • 2022-12-23
相关资源
相似解决方案