File: check_sample_name.sh

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (20 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# This is simple helper script to chreck the name of a file
# the name should appear at least once as:
#
# python $fname
#
# If the file contain its name less times, we print its name.

SAMPLES_SYNC="`dirname ${0}`/../samples/agents"
SAMPLES_ASYNC="`dirname ${0}`/../samples/agents/async_samples"

for sample_dir in "$SAMPLES_SYNC" "$SAMPLES_ASYNC"; do
  for fname in `ls "$sample_dir" | grep \^sample_ | grep \[.\]py\$`; do
    cnt=`grep -c "${fname}" "${sample_dir}/${fname}"`
    if [ $cnt -lt  1 ]; then
      echo "${sample_dir}/${fname} name encountered ${cnt} times."
    fi
  done
done
exit 0