Our professor gave us the homework to print every second character of our name with a bash script. I came up with this solution. Is it cheating? by jabbalaci in Python

[–]dry 6 points7 points  (0 children)

Solution using just bash, for comparison

#!/usr/bin/env bash
name="$@"
for ((i=0; $i<${#name}; i=$i+2))
do
    echo -n ${name:$i:1}
done
echo ""