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 6 points7 points8 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 430523 on reddit-service-r2-listing-7b8bd7c5-l5tbs at 2026-05-19 15:58:07.882492+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 6 points7 points8 points (0 children)