150-applications.sh 597 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. scriptname=$(basename ${BASH_SOURCE[0]})
  3. scriptdirname=$(dirname ${BASH_SOURCE[0]})
  4. bashrcd_dir=~/.bashrc.d
  5. applications_dir=$bashrcd_dir/applications
  6. for i in $applications_dir/*sh; do
  7. debug "include '$i'"
  8. if [ -n "$DEBUG" ]; then
  9. start_ns=$(date +%s%N)
  10. fi
  11. . $i
  12. if [ -n "$DEBUG" ]; then
  13. end_ns=$(date +%s%N)
  14. elapsed_ns=$((end_ns - start_ns))
  15. elapsed_s=$(awk -v ns="$elapsed_ns" 'BEGIN {printf "%.9f", ns / 1000000000}')
  16. debug "\n\t---\n\t--- Dauer: '$i' \n\t---"
  17. debug '\t---\t'$(printf '%s s (%d ns)\n' "$elapsed_s" "$elapsed_ns")
  18. debug '\t---'
  19. fi
  20. done