Conversation
Notices
-
Klaus Jónsson Zimmermann (kzimmermann@quitter.se)'s status on Sunday, 02-Oct-2016 04:31:20 UTC Klaus Jónsson Zimmermann !TIL that you can for-loop in #bash from integer a to b like this: for i in {a..b}; do; done. So simple, and yet so elegant! Love it! - @mcscx@quitter.se and ghostDancer like this.
- Claes Wallin (韋嘉誠) repeated this.
-
Claes Wallin (韋嘉誠) (clackemovedtoheldscalla@quitter.se)'s status on Sunday, 02-Oct-2016 06:06:17 UTC Claes Wallin (韋嘉誠) @kzimmermann ... and explicit sequences and permutations, with constants:
for i in mypic{0..3}{7..9}{d..f}.{gif,jpg}; do echo $i; done -
Klaus Jónsson Zimmermann (kzimmermann@quitter.se)'s status on Sunday, 02-Oct-2016 14:12:51 UTC Klaus Jónsson Zimmermann @clacke that's neat, I didn't know you could chain them like that. I can definitely see some use for these constructions! Claes Wallin (韋嘉誠) likes this.Claes Wallin (韋嘉誠) repeated this. -
@mcscx@quitter.se (mcscx@quitter.se)'s status on Sunday, 02-Oct-2016 16:55:39 UTC @mcscx@quitter.se @clacke even easier: echo {0..3}{7..9}{d..f}.{gif,jpg} You don't need a for-loop for that. Claes Wallin (韋嘉誠) repeated this. -
Claes Wallin (韋嘉誠) (clackemovedtoheldscalla@quitter.se)'s status on Monday, 03-Oct-2016 03:22:58 UTC Claes Wallin (韋嘉誠) @mcscx Not the same! printf '%s\n' {0..3}{7..9}{d..f}.{gif,jpg} though. But the precise command called, or the loop, wasn't the point. :-) @mcscx@quitter.se likes this.