Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F31846966
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Soham
May 29 2020, 2:01 PM
2020-05-29 14:01:28 (UTC+0)
Size
428 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 "it(\s'.*',\sfunction" "$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
8421644
Default Alt Text
raw.txt (428 B)
Attached To
Mode
P11336 Shell script for count number of `it` statements
Attached
Detach File
Event Timeline
Log In to Comment