Page MenuHomePhabricator
Authored By
Soham
May 29 2020, 2:01 PM
Size
428 B
Referenced Files
None
Subscribers
None
```
#!/bin/bash
count_it_recursive () {
shopt -s nullglob dotglob
for pathname in "$1"/*; do
if [ -d "$pathname" ]; then
count_it_recursive "$pathname"
else
case "$pathname" in
*.js)
grep -w -c "it(\s'.*',\sfunction" "$pathname"
esac
fi
done
}
count_it_recursive $1
```
To trigger:
`sh count_it.sh PATH_TO_DIR`

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8421644
Default Alt Text
raw.txt (428 B)

Event Timeline