repo.or.cz
/
cmdllinux.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
update repository
[cmdllinux.git]
/
bash_n_examples
/
bash
/
01comm
/
_find_arr1.sh
blob
ab3d12d4c4642a6abf0c39aaefae6a43d736f5db
1
declare -a
arr
2
num
=
0
3
IFS
=
$
'
\n
'
4
find
-type
f |
while
read
file
;
do
5
FILE
=
${file##*/}
6
DIR
=
${file%/*}
7
num
=
0
8
unset
arr
9
10
while
read
line
;
do
11
arr
[
num
]=
"
$line
"
12
((
num
++ ))
13
done
< <(
find
-path
"
$DIR
"
-prune -o -type
f
-name
"
$FILE
"
-print
)
14
15
if
[[ !
-z
"
$arr
"
]];
then
16
echo
"
$file
"
17
echo
"
${arr[*]/#/->}
"
18
fi
19
done