4 ms·
On the topic of things you didn't know the shell did: I found out about sequences recently and love them: $ echo {0..19} 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
by foobarian 7y ago
On the topic of things you didn't know the shell did: I found out about sequences recently and love them:
$ echo {0..19}
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
$ echo {00..19}
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19
- pkaye 7y agoLooks like it also works with single letters. $echo {A..D} A B C D
- smcameron 7y agoHmm, I'd always used the "seq" command for that... $ echo `seq 0 19` 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
- m463 7y agowow, genius! (the second doesn't work on older versions of bash, like macos)
- perlwle 7y agoPerl is very much like this too. $ perl -le 'print join(" ", "00".."20")' 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20