How do i convert a character from row to column in a shell scripting or command. example: input: HELLO
i want output:
H
E
L
L
O
I tried with tr command . But it doesn't worked
CodePudding user response:
With awk
echo "HELLO" | awk -v FS= -v OFS='\n' '{$1=$1}1'
Or
awk -v FS= -v OFS='\n' '{$1=$1}1' <<< 'HELLO'
CodePudding user response:
A quick one:
$ sed 's/./&\n/g' <<<"HELLO"
H
E
L
L
O