mirror of https://github.com/fengyuhetao/shell.git
19 lines
256 B
Bash
19 lines
256 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# count number of files in your PATH
|
||
|
|
||
|
mypath=`echo $PATH | sed 's/:/ /g'`
|
||
|
count=0
|
||
|
for directory in $mypath
|
||
|
do
|
||
|
check=`ls $directory`
|
||
|
echo $check
|
||
|
for item in $check
|
||
|
do
|
||
|
count=$[ $count + 1 ]
|
||
|
done
|
||
|
echo "$directory - $count"
|
||
|
count=0
|
||
|
done
|
||
|
|