Shell scripting: get total file sizes of a directory

find . -type f -exec du -ch {} + | grep total$
find . -type f -name '*.java' -exec du -ch {} + | grep total$
find . -type f -name '*.pdf' -exec du -ch {} + | grep total$

Eclipse Debug Arguments: double dashes are replaced by single long dash automatically. How to disable smart dashes substitution?

On Eclipse Oxygen, when input double dash -- into "Arguments" of "Debug Configurations...", It substitutes double dash -- with single long dash —
It is really annoying. You cannot even input the correct arguments. The only way to make it work is to disable "Smart Dashes" See below:

  • Right click the Arguments area to open the context menu
  • Select "Substitutions" then uncheck "Smart Dashes"
  • Now you should be able to input double dashes

Mediaflux TCL script: loop through query results with cursors

set size 100
set idx 1
set remaining 1

while { $remaining > 0 } {
    set r [asset.query :size $size :idx $idx :count true :where "namespace>=/test"]
    foreach id [xvalues id $r] {
         puts $id
    set idx [expr { $idx + $size }]
    set remaining [xvalue cursor/remaining $r]