Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31849995
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Soham
Jun 1 2020, 11:22 AM
2020-06-01 11:22:49 (UTC+0)
Size
430 B
Referenced Files
None
Subscribers
None
raw.txt
View Options
```
#!/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 -E "it(\.skip)?\(\s'.*'" "$pathname"
esac
fi
done
}
count_it_recursive $1
```
To trigger:
`sh count_it.sh PATH_TO_DIR`
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8423192
Default Alt Text
raw.txt (430 B)
Attached To
Mode
P11336 Shell script for count number of `it` statements
Attached
Detach File
Event Timeline
Log In to Comment