Bash, version 3

Advanced Bash-Scripting Guide: Prev Chapter 37. Bash, versions 2, 3, and 4 Next On July 27, 2004, Chet Ramey released version 3 of Bash. This update fixed quite a number of bugs and added new features. Some of the more important added features: A new, more generalized {a..z} brace expansion operator. #!/bin/bash for i in {1..10} # Simpler and more straightforward than #+ for i in $(seq 10) do echo -n "$i " done echo # 1 2 3 4 5 6 7 8 9 10 # Or just . . . echo {a..z} # a b c d e f g h i j k l m n o p q r s t u v w x y z echo {e..m} # e f g h i j k l m echo {z..a} # z y x w v u t s r q p o n m l k j i h g f e d c b a # Works backwards, too. echo {25..30} # 25 26 27 28 29 30 echo {3..-2} # 3 2 1 0 -1 -2 echo {X..d} # X Y Z [ ] ^ _ ` a b c d # Shows (some of) the ASCII characters between Z and a, ...

Linked on 2014-05-20 23:17:08 | Similar Links