Karaf Shell Scripting is an incredibly powerful tool - it makes the Karaf platform even more of a very portable operating system riding over the Java Virtual Machine
But I'm learning the pitfalls of upgrading and it impacts shell scripting as well. I recently upgraded from Karaf 4.0.9 to Karaf 4.1.5 and a possibly rash dependence on shell:tac behavior, broke some very critical scripts.
I had created scripts in Karaf 4.0.9 to parse the output of a jdbc:query as follows:
jdbc:query localhost.information_schema "select schema_name from schemata"
The response on screen looks like this:
schema_name
------------------
information_schema
123homeloans
aark_digital
arihant_bak
mysql
performance_schema
sys
I used to parse the output with the following code:
dbList = (jdbc:query $hostName\.information_schema "select schema_name from schemata" | tac) ;
each ($dbList split "\n") {echo $it}
I depended on newlines being inserted by tac. This is no longer the case in Karaf 4.1.5 - you only have spaces between the records
There is also some minor but significant changes in the behavior of scripting around closures - see the following link for a discussion on this: KARAF-5613
As an active developer, I feel the benefits of open software every day. At the same time, having worked for several large corporations, I'm constantly reminded of the vast chasm dividing those of us who believe in the power of 'open', from those who think it is just another nutty hobby. This weblog is a running commentary on my experiments with various open products and libraries in an attempt to bridge this gap...
Showing posts with label apache karaf tac shell script 4.1.5 4.0.9 differences. Show all posts
Showing posts with label apache karaf tac shell script 4.1.5 4.0.9 differences. Show all posts
Sunday, February 18, 2018
Subscribe to:
Posts (Atom)