Guest User

Untitled

a guest
May 25th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.35 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. # TODO: prints error if < 2 arguments
  4.  
  5.  
  6. output="${1}"
  7.  
  8. date>>"${1}"
  9.  
  10. count=0;
  11.  
  12. while [ $# -gt 1 ]
  13. do
  14.   numlines=$(wc -l "${2}")
  15.   echo $numlines #Does it work?
  16.   (( numlines=$numlines-"${2}" ))
  17.   echo $numlines #How about now?
  18.   (( count=$count+$numlines ))
  19.   echo $count #Maybe?
  20.   shift
  21. done
  22.  
  23. # echo "$count total">>"$output"
Add Comment
Please, Sign In to add comment