SHELL script learning
I. print string length
As follows, print the following words with no more than 6 letters
She could see the open door of a departmental office.
Vim print-str.sh
#! / bin/bash
# number of print strings
# the first solution
For i in She could see the open door of a departmental office
Do
[${# I}-le 6] & & echo $I
Done
Echo + +
# the second solution
For i in She could see the open door of a departmental office
Do
[`echo $I | wc-L`-le 6] & & echo $I
Done
Echo + +
# the third solution
Echo "She could see the open door of a departmental office" | awk'{for