15 lines
326 B
Awk
15 lines
326 B
Awk
|
|
#!/usr/bin/awk -f
|
||
|
|
#
|
||
|
|
# Awk script to take a sequence of words separated by spaces and turn them
|
||
|
|
# into a string where each word is followed by as many hyphens as there are
|
||
|
|
# letters in the word itself.
|
||
|
|
#
|
||
|
|
{
|
||
|
|
for (i=1; i<=NF; i++){
|
||
|
|
fill=$i
|
||
|
|
gsub(/./,"-",fill)
|
||
|
|
printf "%s%s",$i,fill
|
||
|
|
}
|
||
|
|
print ""
|
||
|
|
}
|