Chet Ramey | 495aee4 | 2011-11-22 19:11:26 -0500 | [diff] [blame] | 1 | # problem with bash-4.x versions before bash-4.2. required posix interp |
2 | swap32_posix() | ||||
3 | { | ||||
4 | local funcname=swap32_posix | ||||
5 | local arg | ||||
6 | for arg in "$@"; do | ||||
7 | echo $(( | ||||
8 | ($arg & 4278190080) >> 24 | | ||||
9 | ($arg & 16711680) >> 8 | | ||||
10 | ($arg & 65280) << 8 | | ||||
11 | ($arg & 255) << 24 | ||||
12 | )) | ||||
13 | done | ||||
14 | } | ||||
15 | |||||
16 | type swap32_posix |