MAC OSX Mavericks, using bash to see "Get Info" attributes

15
2013-12
  • Rell3oT

    I want to use my bash shell to see the attributes that are shown when you right click on an Application and click Get Info. The specific attributes that I want to know whether or not they are checked is Open in Low Resolution, Prevent App Nap, and Locked.

    I looked in the Info.plist file but only generic information about the file was contained here, not which attributes were checked.

    Is this information contained in the Applications binary? Where is it?

  • Answers
  • Lauri Ranta

    The locked setting is stored as a Finder flag:

    find /Applications/Application.app -maxdepth 1 -flags +uchg|grep -q .&&echo locked
    GetFileInfo /Applications/Application.app|grep -q '^attributes:.*L'&&echo locked
    

    The app nap disabled settings are stored in ~/Library/Preferences/com.apple.LaunchServices.plist:

    $ /usr/libexec/PlistBuddy -c 'Print LSAppNapIsDisabled:com.haystacksoftware.Arq:0' ~/Library/Preferences/com.apple.LaunchServices.plist
    bookH0P
           ApplicationsArq.a�p
    �C8A�@�H���A�1M�$5DF7A03E-A7FB-3E80-B61D-F10CD8BF7B5D/ /Applications/Arq.app�����(Xx 0H@h  � � � �  �0 �$�0
    

    osascript -e 'tell app "Finder" to info for (POSIX file "/Applications/Application.app")' does not include either of those settings.


  • Related Question

    Bash compleation error Mac OSX
  • errm

    Im getting a

    -bash: complete: bashdefault: invalid option name
    

    when I fire up my terminal. Any ideas as to what I messed up and where?

    running bash -x

    + '[' -n '\s-\v\$ ' ']'
    + PS1=\h:\w \u\$ 
    + shopt -s checkwinsize
    

    and 'bash -lx'

    + bash -lx
    + PATH=/bin:/sbin:/usr/bin:/usr/sbin
    + export PATH
    + '[' /bin/bash '!=' no ']'
    + '[' -r /etc/bashrc ']'
    + . /etc/bashrc
    ++ '[' -n '\s-\v\$ ' ']'
    ++ PS1=\h:\w \u\$ 
    ++ shopt -s checkwinsize
    + export PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
    + PATH=/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
    + export DISPLAY=:0
    + DISPLAY=:0
    + [[ -s /Users/ed/.rvm/scripts/rvm ]]
    + source /Users/ed/.rvm/scripts/rvm
    ++ grep -q '^rvm ()'
    +++ declare -f
    ++ [[ 1 -gt 0 ]]
    ++ [[ 0 -eq 0 ]]
    ++ [[ -f /etc/rvmrc ]]
    ++ [[ -f /Users/ed/.rvmrc ]]
    ++ [[ -z 1 ]]
    ++ [[ -z '' ]]
    ++ [[ 1 = \0 ]]
    ++ rvm_prefix=/Users/ed/.
    ++ echo /Users/ed/.
    ++ grep -vq '\(\/\|\.\)$'
    ++ rvm_prefix_needs_trailing_slash=1
    ++ [[ /Users/ed/. = \/\u\s\r\/\l\o\c\a\l ]]
    ++ [[ 1 = \0 ]]
    ++ [[ -z /Users/ed/.rvm ]]
    ++ [[ -d /Users/ed/.rvm ]]
    ++ [[ -f /Users/ed/.rvm/scripts/array ]]
    ++ source /Users/ed/.rvm/scripts/array
    +++ [[ -n '' ]]
    +++ __array_start=0
    ++ [[ -f /Users/ed/.rvm/scripts/utility ]]
    ++ source /Users/ed/.rvm/scripts/utility
    ++ [[ -f /Users/ed/.rvm/scripts/initialize ]]
    ++ source /Users/ed/.rvm/scripts/initialize
    +++ [[ -n '' ]]
    +++ [[ -n 2.05b.0(1)-release ]]
    +++ shopt -s extglob
    +++ [[ 1 -eq 0 ]]
    +++ rvm_bin_path=/Users/ed/.rvm/bin
    +++ rvm_man_path=/Users/ed/.rvm/man
    +++ rvm_rc_files=/Users/ed/.bash_profile /Users/ed/.bashrc /Users/ed/.zshenv
    +++ [[ -n '' ]]
    +++ rvm_gems_cache_path=/Users/ed/.rvm/gems/cache
    +++ export rvm_path rvm_bin_path rvm_gems_cache_path rvm_gemset_separator rvm_selfcontained
    ++ [[ -f /Users/ed/.rvm/scripts/version ]]
    ++ source /Users/ed/.rvm/scripts/version
    ++ [[ -f /Users/ed/.rvm/scripts/selector ]]
    ++ source /Users/ed/.rvm/scripts/selector
    ++ [[ -f /Users/ed/.rvm/scripts/cli ]]
    ++ source /Users/ed/.rvm/scripts/cli
    ++ [[ -f /Users/ed/.rvm/scripts/cd ]]
    ++ source /Users/ed/.rvm/scripts/cd
    +++ [[ 1 -ne 0 ]]
    +++ [[ -n '' ]]
    +++ complete -o bashdefault -o default -o filenames -o dirnames -o nospace -F _rvm_cd_complete cd
    bash: complete: bashdefault: invalid option name
    ++ [[ -f /Users/ed/.rvm/scripts/override_gem ]]
    ++ source /Users/ed/.rvm/scripts/override_gem
    +++ [[ 0 -eq 0 ]]
    +++ awk '/:/{printf $NF"."}' /Users/ed/.rvm/lib/VERSION.yml
    ++ rvm_version=1.0.21.
    ++ export rvm_version=1.0.21
    ++ rvm_version=1.0.21
    ++ alias 'rvm-restart=source '\''/Users/ed/.rvm/scripts/rvm'\'''
    ++ command -v ruby
    ++ command -v ruby
    ++ grep -v rvm
    ++ [[ -s /Users/ed/.rvm/environments/default ]]
    ++ source /Users/ed/.rvm/environments/default
    +++ export PATH=/Users/ed/.rvm/gems/ruby-1.8.7-p302/bin:/Users/ed/.rvm/gems/ruby-1.8.7-p302@global/bin:/Users/ed/.rvm/rubies/ruby-1.8.7-p302/bin:/Users/ed/.rvm/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
    +++ PATH=/Users/ed/.rvm/gems/ruby-1.8.7-p302/bin:/Users/ed/.rvm/gems/ruby-1.8.7-p302@global/bin:/Users/ed/.rvm/rubies/ruby-1.8.7-p302/bin:/Users/ed/.rvm/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
    +++ rvm_path=/Users/ed/.rvm
    +++ export rvm_path
    +++ RUBY_VERSION=ruby-1.8.7-p302
    +++ export RUBY_VERSION
    +++ GEM_HOME=/Users/ed/.rvm/gems/ruby-1.8.7-p302
    +++ export GEM_HOME
    +++ GEM_PATH=/Users/ed/.rvm/gems/ruby-1.8.7-p302:/Users/ed/.rvm/gems/ruby-1.8.7-p302@global
    +++ export GEM_PATH
    +++ BUNDLE_PATH=/Users/ed/.rvm/gems/ruby-1.8.7-p302
    +++ export BUNDLE_PATH
    +++ MY_RUBY_HOME=/Users/ed/.rvm/rubies/ruby-1.8.7-p302
    +++ export MY_RUBY_HOME
    +++ IRBRC=/Users/ed/.rvm/rubies/ruby-1.8.7-p302/.irbrc
    +++ export IRBRC
    +++ rvm_ruby_string=ruby-1.8.7-p302
    +++ export rvm_ruby_string
    +++ unset rvm_gemset_name
    +++ unset MAGLEV_HOME
    ++ __rvm_conditionally_add_bin_path
    ++ grep -vqF '/Users/ed/.rvm/bin '
    ++ printf '/Users/ed/.rvm/gems/ruby-1.8.7-p302/bin /Users/ed/.rvm/gems/ruby-1.8.7-p302@global/bin /Users/ed/.rvm/rubies/ruby-1.8.7-p302/bin /Users/ed/.rvm/bin /opt/local/bin /opt/local/sbin /bin /sbin /usr/bin /usr/sbin'
    ++ return 0
    ++ unset rvm_prefix_needs_trailing_slash rvm_bin_path rvm_man_path rvm_rc_files rvm_gems_path rvm_gems_cache_path rvm_interactive_flag rvm_gems_path rvm_project_rvmrc_default rvm_gemset_separator
    ++ [[ 0 -gt 0 ]]
    

  • Related Answers
  • Lawrence Velázquez

    Your problem seems to be at the line

    +++ complete -o bashdefault -o default -o filenames -o dirnames -o nospace -F _rvm_cd_complete cd
    bash: complete: bashdefault: invalid option name
    

    Try to find that complete … line in one of your startup scripts. (Look for files in your home directory named .bash_profile, .bash_login, .profile or .bashrc.) If you require that line, you’ll have to figure out why it’s throwing that “invalid option name” error. I think complete is a bash builtin command, so you should check the bash man page by running man bash.

    Of course, if you have no idea why it’s there, you’re probably better off commenting it out by prefacing it with a # symbol.