150-applications.sh 596 B

123456789101112131415161718192021222324252627282930
  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. fi
  17. debug "\n\t---\n\t--- Dauer: '$i' \n\t---"
  18. debug '\t---\t'$(printf '%s s (%d ns)\n' "$elapsed_s" "$elapsed_ns")
  19. debug '\t---'
  20. done