File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 9
9
# Directory to search
10
10
directory=$1
11
11
12
- # Find Mach-O and Universal Binary files in the specified directory
13
- files=$( find " $directory " -type f -exec sh -c ' file -b "$1" | grep -q "Mach-O|universal binary" && echo "$1"' _ {} \; )
14
-
15
12
# Initialize an empty string for the output
16
13
output=" "
17
14
18
- # Loop through each file and format it
19
- for file in $files ; do
20
- if [ -z " $output " ]; then
21
- output=" \" $file \" "
22
- else
23
- output=" $output ,\" $file \" "
24
- fi
25
- done
15
+ # Find Mach-O and Universal Binary files in the specified directory
16
+ find " $directory " -type f -exec sh -c '
17
+ for file do
18
+ if file "$file" | grep -qE "Mach-O|universal binary"; then
19
+ if [ -n "$output" ]; then
20
+ output="${output},"
21
+ fi
22
+ output="${output}\"$file\""
23
+ fi
24
+ done
25
+ ' sh {} +
26
26
27
- # Print the formatted output
27
+ # Print the output
28
28
echo $output
You can’t perform that action at this time.
0 commit comments