#!/bin/sh check_for_dup_ncurses() { elfdump -d $1 2> /dev/null | awk -v file="$file" ' \ /d_tag:/ { tag=$2 } \ /d_val:/ { \ if (tag == "DT_NEEDED") { \ if ( $2 ~ /libncurses\./ || $2 ~ /libncursesw\./ ) { \ if (curses_found) { \ print file exit 1; \ } \ curses_found = 1 \ } \ } \ }' } for file in "$@"; do check_for_dup_ncurses "$file" done