aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorRob Savoye <rob.savoye@linaro.org>2013-07-26 16:37:26 -0600
committerRob Savoye <rob.savoye@linaro.org>2013-07-26 16:37:26 -0600
commit6425ee34654594867466cfccf4d5c0ea4e22aa9a (patch)
tree610abd249fa592ffec77652d4605d0d801a64617 /README
parenta0e0108f90f3555cb675ba57814e198fa09610a7 (diff)
add notes on shell scripting
Diffstat (limited to 'README')
-rw-r--r--README31
1 files changed, 21 insertions, 10 deletions
diff --git a/README b/README
index 23826bc..85d14ed 100644
--- a/README
+++ b/README
@@ -189,15 +189,26 @@ Spec CPU 2006
* Peak Seconds
* Peak Ratio
+Notes on Bourne Shell Scripting
+-------------------------------
+ These scripts use a few techniques in many places that relate to
+shell functions. One is heavy use of bourne shell functions to reduce
+duplication, and make the code better organized. Any string echo'd by
+a function becomes it's return value. Bourne shell supports 2 types of
+return values though. One is the string returned by the function. This
+is used whenever the called function returns data. This is captured by
+the normal shell commands like this: values="`call_function $1`". The
+other type of return value is a single integer. Much like system
+calls, these scripts all return 0 for success, and 1 for errors. This
+enables the calling function to trap errors, and handle them in a
+clean fashion.
+
+ A few good habits to mention, always enclose a sub shell execution
+in double quotes. If the returned string contains spaces, this
+preserves the data, otherwise it'll get truncated.
+
+ Another good habit is to alwayys prepend a character when doing
+string comparisons. If one of the two strings is undefined, the script
+will abort. So always using "test x${foo} = xbar" is the safest.
---without-ppl
---without-cloog
---disable-libssp
---disable-libmudflap
---disable-libgomp
---disable-tls
---disable-libitm
---disable-nls
---disable-libquadmath
---disable-plugin