Last active
April 21, 2025 23:37
-
-
Save smartwatermelon/21af7732257345a3635eba4d231c0fee to your computer and use it in GitHub Desktop.
@cassidoo's interview question from April 20, 2025, in Bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one-liner in Bash | |
$ target=3; for i in "flour:200" "sugar:100" "eggs:2"; do echo "${i%%:*}:$(( ${i##*:} * target ))"; done | |
flour:600 | |
sugar:300 | |
eggs:6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment