Reputation: 1101
I am trying to build a script that will print on screen each char from the given string.
Lets say I call the script show_chars
then
./show_chars bkob bk.is
will give me
b
k
o
b
b
k
.
i
s
Upvotes: 2
Views: 54
Reputation: 785128
You can use fold
for this:
s='bkob bk.is'
fold -w1 <<< "$s"
b
k
o
b
b
k
.
i
s
As per man fold
:
-w, --width=WIDTH
use WIDTH columns instead of 80
Upvotes: 4