Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Bash versions support ====== The main bash version targeted is the 3.x line and generally won't work in older versions. * ''vcs'' version 1.0.11 included patches to run on bash 2.x but never really worked * **''vcs'' version 1.11 and 1.12 work on bash 2.05b and higher**, 1.12.2 will be the last version capable of doing so, newer versions will require bash 3.1 ====== Development notes ====== ======= Syntax in 2.05b not used ======= References: http://wiki.bash-hackers.org/scripting/bashchanges * ''for <nowiki>((;;))</nowiki>'': C-style for. Loops in bash are *really* slow, an inline AWK loop, is much faster * ''<nowiki>[[ ... ]]</nowiki>'': ''test'' replacement. Builtin with cleaner syntax and parsing, no need to quote, grouping (parentheses), ''&&'' and ''||'' instead of ''-a'' and ''-o'', arithmetic operators (e.g. ''-eq'') force arithmetic evaluation (i.e. <nowiki>[[ 2 -eq "1+1" ]]</nowiki> is true): \\ ''[ "$VAR" = "$X" -a 2 -eq <nowiki>$(( 1+1 ))</nowiki> ]'' -> ''<nowiki>[[ $VAR = $X && 2 -eq '1+1' ]]</nowiki>'' \\ **Pitfall**: When unquoted, the right hand side of a text comparison ('=', '==' and '!=') is considered a pattern ((http://wiki.bash-hackers.org/syntax/ccmd/conditional_expression)) ((http://wiki.bash-hackers.org/syntax/pattern)) ====== Syntax in 3.1 ====== * ''caller'': ''caller 0'' prints the calling function and line * ''<nowiki>[[ =~ ]]</nowiki>'': Pattern matching (right side can be an extended regular expression) ((http://wiki.bash-hackers.org/syntax/ccmd/conditional_expression)) \\ **Pitfalls**: when quoted, it isn't considered an ERE in bash 3.2 and up, but it is in bash 3.1. A variable can be used to get the same behaviour or the shell settings ''shopt compat31'' / ''shopt compat32'' be used. All dates/times in this page are UTC. vcs/docs/devel/bash_support.txt Last modified: 2016/04/17 23:28by Toni Corvera Log In