@@ -132,7 +132,7 @@ information is recommended.
132132
133133``` shell
134134err () {
135- echo " [$( date +' %Y-%m-%dT%H:%M:%S%z' ) ]: $* " > & 2
135+ echo " [$( date +' %Y-%m-%dT%H:%M:%S%z' ) ]: $* " >&2
136136}
137137
138138if ! do_something; then
@@ -758,6 +758,7 @@ removed `./somefile'
758758
759759` eval` should be avoided.
760760
761+
761762Eval munges the input when used for assignment to variables and can
762763set variables without making it possible to check what those variables
763764were.
@@ -1146,15 +1147,13 @@ my_func2() {
11461147### Function Location
11471148
11481149Put all functions together in the file just below constants. Don' t hide
1149- executable code between functions.
1150+ executable code between functions. Doing so makes the code difficult to follow
1151+ and results in nasty surprises when debugging.
11501152
11511153If you' ve got functions, put them all together near the top of the
11521154file. Only includes, `set` statements and setting constants
11531155may be done before declaring functions.
11541156
1155- Don' t hide executable code between functions. Doing so makes the code
1156- difficult to follow and results in nasty surprises when debugging.
1157-
11581157<a id="s7.8-main"></a>
11591158
11601159### main
@@ -1193,14 +1192,14 @@ Example:
11931192
11941193```shell
11951194if ! mv "${file_list[@]}" "${dest_dir}/"; then
1196- echo " Unable to move ${file_list[*]} to ${dest_dir} " > & 2
1195+ echo "Unable to move ${file_list[*]} to ${dest_dir}" >&2
11971196 exit 1
11981197fi
11991198
12001199# Or
12011200mv "${file_list[@]}" "${dest_dir}/"
12021201if (( $? != 0 )); then
1203- echo " Unable to move ${file_list[*]} to ${dest_dir} " > & 2
1202+ echo "Unable to move ${file_list[*]} to ${dest_dir}" >&2
12041203 exit 1
12051204fi
12061205```
@@ -1213,7 +1212,7 @@ following is acceptable:
12131212` ` ` shell
12141213tar -cf - ./* | ( cd " ${dir} " && tar -xf - )
12151214if (( PIPESTATUS[0 ] != 0 || PIPESTATUS[1 ] != 0 )) ; then
1216- echo "Unable to tar files to ${dir}" > &2
1215+ echo " Unable to tar files to ${dir} " >&2
12171216fi
12181217` ` `
12191218
0 commit comments