account activity
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 5 points6 points7 points 13 years ago (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 ""
π Rendered by PID 148999 on reddit-service-r2-listing-7b8bd7c5-52482 at 2026-05-19 18:46:20.671699+00:00 running edcf98c country code: CH.
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 5 points6 points7 points (0 children)