parsing 'ls' considered harmful
This commit is contained in:
parent
05978c6c18
commit
0dd6939da2
|
@ -6,7 +6,7 @@ log_dir = LOG_DIR
|
||||||
|
|
||||||
users.each do |user|
|
users.each do |user|
|
||||||
size = `du -B1 #{shot_dir}#{user}/ | awk {'print $1'} | head -n 1`
|
size = `du -B1 #{shot_dir}#{user}/ | awk {'print $1'} | head -n 1`
|
||||||
count = `ls -1 #{shot_dir}#{user}/ | wc -l | head -n 1`
|
count = `find #{shot_dir}#{user}/ -maxdepth 1 -type f | wc -l | head -n 1`
|
||||||
|
|
||||||
[size,count].each do |x|
|
[size,count].each do |x|
|
||||||
x.delete! "\n"
|
x.delete! "\n"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user