Skip to content

Commit

Permalink
Demo to show that isElfSimple works in a loop reading from stdin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Chu committed Aug 26, 2017
1 parent ed80e37 commit f61ff5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hard-coded-descriptors/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ isElfSimple() {
[[ "$magic" =~ ELF ]]
}

isElfSimpleWithStdin() {
seq 3 > /tmp/3.txt
while read line; do
echo $line
isElfSimple /bin/true && echo YES
isElfSimple $0 || echo NO
echo
done < /tmp/3.txt
}

compareIsElf() {
local path=$1
isELF "$path" && echo "YES isELF $path" || echo "NO isELF $path"
Expand Down

0 comments on commit f61ff5c

Please sign in to comment.