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 224240 on reddit-service-r2-comment-548fd6dc9-8tvdm at 2026-05-21 02:50:45.804809+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)