Advertisement
add1ctus

[OS] Lab 6.8

Jun 18th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. #!/bin/bash
  2. RESULT=0
  3. for FILE in `ls $1`
  4. do
  5.         if [ ! -d $FILE ]
  6.         then
  7.                 RESULT=$(( $RESULT + `ls -l $1/$FILE | awk '{print $6}'` ))
  8.         else
  9.                 RESULT=$(( $RESULT + `bash $0 $FILE` ))
  10.         fi
  11. done
  12. echo $RESULT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement