rosrun: replaced `...` with $(...) (#175)
Christopher Wecht authored 6 years ago
Dirk Thomas committed 6 years ago
48 | 48 | |
49 | 49 | if [[ -n $CMAKE_PREFIX_PATH ]]; then |
50 | 50 | IFS=$'\n' |
51 | catkin_package_libexec_dirs=(`catkin_find --without-underlays --libexec --share "$1" 2> /dev/null`) | |
51 | catkin_package_libexec_dirs=($(catkin_find --without-underlays --libexec --share "$1" 2> /dev/null)) | |
52 | 52 | unset IFS |
53 | 53 | debug "Looking in catkin libexec dirs: $catkin_package_libexec_dirs" |
54 | 54 | fi |
55 | pkgdir=`rospack find "$1"` | |
55 | pkgdir=$(rospack find "$1") | |
56 | 56 | debug "Looking in rospack dir: $pkgdir" |
57 | 57 | if [[ ${#catkin_package_libexec_dirs[@]} -eq 0 && -z $pkgdir ]]; then |
58 | 58 | exit 2 |
61 | 61 | # The -perm /mode usage is not available in find on the Mac |
62 | 62 | #exepathlist=(`find $pkgdir -name $2 -type f -perm /u+x,g+x,o+x`) |
63 | 63 | # -L: #3475 |
64 | if [[ `uname` == Darwin ]]; then | |
64 | if [[ $(uname) == Darwin ]]; then | |
65 | 65 | _perm="+111" |
66 | 66 | else |
67 | 67 | _perm="/111" |
68 | 68 | fi |
69 | 69 | debug "Searching for $2 with permissions $_perm" |
70 | exepathlist="`find -L "${catkin_package_libexec_dirs[@]}" "$pkgdir" -name "$2" -type f -perm "$_perm" ! -regex ".*$pkgdir\/build\/.*" | uniq`" | |
70 | exepathlist="$(find -L "${catkin_package_libexec_dirs[@]}" "$pkgdir" -name "$2" -type f -perm "$_perm" ! -regex ".*$pkgdir\/build\/.*" | uniq)" | |
71 | 71 | IFS=$'\n' |
72 | 72 | exepathlist=($exepathlist) |
73 | 73 | unset IFS |
74 | 74 | unset _perm |
75 | 75 | if [[ ${#exepathlist[@]} == 0 ]]; then |
76 | 76 | echo "[rosrun] Couldn't find executable named $2 below $pkgdir" |
77 | nonexepathlist=(`find -H "$pkgdir" -name "$2"`) | |
77 | nonexepathlist=($(find -H "$pkgdir" -name "$2")) | |
78 | 78 | if [[ ${#nonexepathlist[@]} != 0 ]]; then |
79 | 79 | echo "[rosrun] Found the following, but they're either not files," |
80 | 80 | echo "[rosrun] or not executable:" |