Skip to content

Instantly share code, notes, and snippets.

@drkibitz
Created February 9, 2014 08:11

Revisions

  1. drkibitz revised this gist Feb 9, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions otool-ls-r
    Original file line number Diff line number Diff line change
    @@ -15,3 +15,5 @@ otool_list() {
    done
    fi
    }

    otool_list "$@"
  2. drkibitz created this gist Feb 9, 2014.
    17 changes: 17 additions & 0 deletions otool-ls-r
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/bash

    list=""

    otool_list() {
    local lib="$1"
    local libs=""
    if [[ "$list" == "${list/:$lib/}" ]]; then
    echo "$lib"
    list="$list:$lib"
    libs=$(otool -L "$lib" | sed -n 's/^ \(.*\) (compatibility version.*$/\1/p')
    for lib in $libs
    do
    otool_list "$lib"
    done
    fi
    }