-bash: /usr/bin/grep: Bad executable (or shared library)

I am receiving these error messages when I attempt to use grep, egrep, or fgrep from the terminal:
-bash: /usr/bin/grep: Bad executable (or shared library)
-bash: /usr/bin/egrep: Bad executable (or shared library)
-bash: /usr/bin/fgrep: Bad executable (or shared library)
I suspect that a library that these utilities use is corrupt, but I am not sure how to determine what libraries the executables use and how to restore them if they are indeed corrupt. Can someone fill me in?
Thanks,
Greg
Dual 2 GHz PowerPC G5   Mac OS X (10.4.7)  

Hi Greg,
   Sorry, otool is installed by Apple's Developer Tools package. The other listings you posted are also identical to mine so I'm stumped. I also have a G5 so the fact that your items are the same size as mine is at least strong evidence that they aren't corrupted.
   You can use the application Pacifist, to pull a new copy of grep from your Mac OS X install disk. It couldn't hurt to be sure.
   libSystem.B.dylib is in turn dependent on /usr/lib/system/libmathCommon.A.dylib so there's one more possibility for a problem but there the dependency chain stops. Besides, if either of those libraries were corrupted, I would think you would have noticed something before.
   You should check to see if the following environment variable is defined: (it should not be defined)
echo $DYLDLIBRARYPATH
You should also login as another user (even if you have to create one temporarily) and execute grep. If that user can do it then the problem lies in the environment of your current user.
Gary
~~~~
   Old Mother Hubbard went to the cupboard
   To fetch her poor daughter a dress.
   When she got there, the cupboard was bare
   And so was her daughter, I guess...

Similar Messages

  • Bash: /usr/bin/hamachi: No such file or directory

    root@SLR:~$ sudo hamachi  or root@SLR:~$ sudo hamachi startand the output is bash: /usr/bin/hamachi: No such file or directoryI am using installer logmein-hamachi_2.1.0.139-1_armhf.deb OS is Ubuntu Mate (Raspberry PI 2 - Model B)  Ubuntu Software Center says Logmein Hamachi is installed and has an accurate description of the program. I have tried command line install of hamachi and ubuntu package, both install successfully. When I run the 3rd party program, Haguichi, it says hamachi is not installed, but it is! I have confirmed that the hamachi files are in the locations in which they are trying to execute. I have made a clean install of the OS, Ubuntu Mate, running only these commands which worked great with no issues. sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get update
    sudo apt-get install lsb-core
    sudo wget https://secure.logmein.com/labs/logmein-hamachi_2.1.0.139-1_armhf.deb
    sudo dpkg -i logmein-hamachi_2.1.0.139-1_armhf.deb Can someone please suggest what may be causing the issue? Thank you.SLR 

    # uname -a
    Linux isengard 2.6.30-ARCH #1 SMP PREEMPT Sat Jul 4 02:24:43 CEST 2009 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux
    # file /usr/bin/pacman
    /usr/bin/pacman: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
    ya.. thanks, i was guessing it, but dunno how to figure it out. i have no idea why the architecture changed. iam going to recompile packman!
    thanks for your help
    edit:
    when i installed my 32bit system i changed the mirrorlist to 'i686' repository for downloading 32bit things. i forgot to change it again when i was done... so pacman downloaded 32bit stuff and apparently updatet itself.
    Last edited by crabmeat (2009-08-12 11:25:14)

  • /usr/bin/ld: CANNOT EXECUTE binary file!

    So whenever I try to compile something, I get to the step
    checking for gcc... gcc
    checking for C compiler default output file name...
    configure: error: C compiler cannot create executables
    See `config.log' for more details.
    And looking at the log, my problem is...
    /usr/bin/ld: /usr/bin/ld: cannot execute binary file
    Which... Is bad. Yes, I've tried chmodding it +x. I've also tried logging in as root and trying to run it, no luck.
    What's wrong? =/
    Would asking someone else with an iMac G5 to send me theirs, fix it?

    Running configure on all open source packages brings me to the ld cannot execute error in configure.log. In this case I was attempting to build libssh2 (SSH functions for PHP).
    Thanks for the link Nils, I'll try that.

  • [SOLVED]pacman fails to upgrade... /usr/bin/vercmp: cannot execute bin

    Proceed with installation? [Y/n] y
    :: Retrieving packages from core...
    pacman-3.2.1-1-x86_64 491.3K 1850.7K/s 00:00:00 [########################################################################################################] 100%
    checking package integrity...
    (1/1) checking for file conflicts [########################################################################################################] 100%
    (1/1) upgrading pacman [########################################################################################################] 100%
    warning: /etc/pacman.d/mirrorlist installed as /etc/pacman.d/mirrorlist.pacnew
    /tmp/alpm_eT02H1/.INSTALL: line 5: /usr/bin/vercmp: cannot execute binary file
    /tmp/alpm_eT02H1/.INSTALL: line 5: [: : integer expression expected
    Here is more info on my system and the file vermcp is installed and permissions seem correct.
    http://rafb.net/p/MYk3pO21.html
    HELP?
    Last edited by rooloo (2008-09-09 00:07:09)

    Ok, this was my dumb mistake again. I was testing out powerpill on my server which is a 32 bit machine. I tried copying my 64 bit mirrorlist to my 32 bit server because I have it ranked and slimmed down to only the essential servers.

  • How to change /usr/bin/grep To /usr/local/bin/grep

    Hi
    I have installed GNU Grep but when I am giving the command #which grep it is showing me solaris grep i.e /usr/bin/grep.
    My question is how do I change it to /usr/local/bin/
    Thanks in advance
    Sukrut

    You have a few options:
    1) place /usr/local/bin before /usr/bin in your PATH environment variable
    2) remove /usr/bin/grep altogether
    3) move /usr/bin/grep to something else (ie: /usr/bin/solaris/grep) and symlink /usr/bin/grep to /usr/local/bin/grep just in case any hard coded programs/scripts rely on /usr/bin/grep being present.
    I prefer step #3 since most of the various gnu utilities are virtually 100% drop-in replacements.

  • Executable and shared library portability

    Hi,
    What are things that one should keep in mind when trying to deploy executables and shared library built on one machine to another.
    Thanks

    1. Use compiler options to generate code for the most generic of the machines you intend to support. For example, if you intend to run on UltraSparc II systems, don't generate code for US III. The option -xarch=v8plus is suitable for all 32-bit Sparc systems less than 10 years old. Avoid -xchip, -xcache, and other processor-specific options.
    2. Build on the earliest version of Solaris that you intend to support. If you allow your clients to use Solaris 8 or later, you must build your libraries and applications on Solaris 8. Binaries created on later versions of Solaris cannot be expected to work on earlier versions of Solaris, but can be expected to work on later versions.
    3. Do not link system libraries statically. Always link the shared library. Static versions of system libraries can't be expected to work a a different version of Solaris, or on a different patch level of the same Solaris version.
    4. Make a note of the patch level of system libraries on your build system. For C++, check especially the patch level of SUNWlibC. Clients might need the same or later patch levels on their systems. For our products, we set up our build machines with the earliest patch levels that allow our products to work. We document those patch levels, and provide the minimum patches with the product installation. If a client system has a later patch level, the patch we supply won't be installed, and the later patch level should allow the product to work correctly.

  • /usr/bin binaries automatically executed?

    "Houston, we have a problem"
    I've put in /usr/bin/ a simple script  /usr/bin/pumount (I moved the original pumount in pumount_normal)
    the pumount content is this:
    #!/bin/bash
    pumount_original $1
    notify-send -i drive-removable-media 'USB storage device removed: ' $1
    echo media_removed > /dev/vc/1
    the problem is that it is AUTOMATICALLY launched at every startup, so (I suppose) every /usr/bin/ is launched on startup...
    (I have my noteo notify the launch of the notify-send and "media_removed" appear on my vc1)
    and this appen too for some other "folder" for scripts... (I tried /usr/sbin too)
    now, maybe this is totally normal and I'm simply stupid (:P) but /usr/bin contains 1140 files on my system....
    I'm not sure why this happen, and I reinstalled arch one month ago, so I don't think I already broke it << (I hope at least..)
    Tell me if you too experiment this issue, and if it's an issue..
    Thanks for the attention..
    bye

    sniffles wrote:
    _Marco_ wrote:@sniffles
    why should my system call a "pumount " without args in the boot?
    I think obviously there is a problem, the point is "it's only for me or for every archer?"
    I have no idea why, I don't have that particular thing on my system. Now that iphitus gave you a reason, my scenario does not seem so laughable, does it? A lot more credible than "omg my system runs everything in /usr/bin/ on every boot!" (do you even realise what that would do?)
    well, did you have an idea before iphitus pointed out this?
    I just had mine script executed on every boot and I didn't found any reason for this...
    I realise what that would do, but if I don't understand something I study it (tried to get it work for two hours) and, if I still don't understand, I ask to someone more expert.
    excuse me if I choose this forum.. didn't know it was a philosophy forum, I thought it was ArchLinux forum.
    edit:
    for the fork bomb it was more a "demonstrative" thing that anything else... (the "aim" were more important of the "result")
    if I had the will to crash his computer I would have tested it on my box first... don't you think?
    anyway this is not the point.
    next time I ask something stupid, please,  simply start reading another topic.
    Nobody need that kind of help.
    Last edited by _Marco_ (2008-06-09 10:16:26)

  • Wine not working: Accessing a corrupted shared library

    After installing wine via pacman (wine-1.3.3) i get only error:
    bash-4.0# wine
    bash: /usr/bin/wine: Accessing a corrupted shared library
    Is anyone had this problem and know solution?
    My Arch is 2.6.30-ARCH x86_64
    thank you for any help

    .:B:. wrote:Not really, if he's running 2.6.30-ARCH .
    *bangs head*
    I KNEW quick checks when in the office were a bad idea.

  • Shared library path

    I am trying to start the weblogic server 5.1 on my linux machine.
    After I execute the startWebLogic.sh file, the following error appears
    -bash: Dont know how to set the shared library path for Linux
    bash: /usr/java/bin/java: No such file or directory
    How do I fix this ?
    Thanks
    Nikhil

    hi.
    find out what 'uname -s' returns on your system. In earlier WLS5.1
    scripts the script looked for "LINUX" but uname -s (as called in the
    script) returns "Linux" (note the case difference). I modified my script
    from:
    LINUX)
    to
    Linux|LINUX
    I also see that you need to modify your JAVA_HOME variable at the top of
    the script to the correct location of your JDK installation.
    Hope this helps,
    Michael
    Nikhil wrote:
    I am trying to start the weblogic server 5.1 on my linux machine.
    After I execute the startWebLogic.sh file, the following error appears
    -bash: Dont know how to set the shared library path for Linux
    bash: /usr/java/bin/java: No such file or directory
    How do I fix this ?
    Thanks
    Nikhil--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • [SOLVED] Samba can't find shared library libsasl2.so.2

    Samba is installed but won't start. systemctl status smbd.service returns:
    smbd.service - Samba SMB/CIFS server
    Loaded: loaded (/usr/lib/systemd/system/smbd.service; enabled)
    Active: failed (Result: exit-code) since Wed 2013-05-22 10:17:03 EDT; 41min ago
    May 22 10:17:03 andydesktop systemd[1]: Starting Samba SMB/CIFS server...
    May 22 10:17:03 andydesktop smbd[1421]: /usr/bin/smbd: error while loading shared libraries: libsasl2.so.2: cannot open shared object file: No such file or directory
    May 22 10:17:03 andydesktop systemd[1]: smbd.service: control process exited, code=exited status=127
    May 22 10:17:03 andydesktop systemd[1]: Failed to start Samba SMB/CIFS server.
    May 22 10:17:03 andydesktop systemd[1]: Unit smbd.service entered failed state
    I have updated with pacman -Syu and installed libsasl. I tried enabling the testing repositories, but I don't think it found a newer version (not 100% sure about this but it is still broken). pacman -Qi libsasl returns:
    Name : libsasl
    Version : 2.1.26-2
    Description : Cyrus Simple Authentication Service Layer (SASL) Library
    Architecture : x86_64
    URL : http://cyrusimap.web.cmu.edu/
    Licenses : custom
    Groups : None
    Provides : None
    Depends On : openssl krb5
    Optional Deps : None
    Required By : cyrus-sasl libldap
    Optional For : None
    Conflicts With : cyrus-sasl-plugins
    Replaces : None
    Installed Size : 582.00 KiB
    Packager : Bartłomiej Piotrowski <[email protected]>
    Build Date : Sat 11 May 2013 02:33:27 AM EDT
    Install Date : Wed 22 May 2013 10:41:32 AM EDT
    Install Reason : Installed as a dependency for another package
    Install Script : No
    Validated By : Signature
    locate libsasl2 returns:
    /usr/lib/libsasl2.so
    /usr/lib/libsasl2.so.3
    /usr/lib/libsasl2.so.3.0.0
    Seems to me samba's looking for an older version of libsasl, but I'm not sure which one to downgrade to - or if that's even the right solution.
    I found some info in this topic but I still can't figure out how to get so.2: https://bbs.archlinux.org/viewtopic.php?pid=1272906 I did notice that my libsasl was built a day after the one in that thread; maybe they changed something?
    Any help is greatly appreciated! Thanks!
    Last edited by andybp85 (2013-05-22 17:00:11)

    karol wrote:/usr/bin/smbd is provided by samba, not smbclient.
    But smbd is linked to a lot of libs from smbclient. If one of those libs is linked to libsasl2.so.2, you would get this same error.
    Check it out, smbd isn't linked directly to libsasl at all. objdump -x /usr/bin/smbd | grep NEEDED

  • Bash: /mnt/cdrom/runInstaller: /bin/sh: bad interpreter: Permission denied

    hi,
    i m new to oracle on linux
    Oracle 10gR2 on RedHat Enterprise Linux 5
    while running ./runInstaller
    this error displays
    bash: /media/database/runInstaller: /bin/sh: bad interpreter: Permission denied
    can any one help me, please answer here or [email protected]

    It's got nothing to do with who he's running the installer as (though he should indeed run it as the oracle user, of course).
    It's got everything to do with the fact that a lot of distros these days automount their CDs with the noexec switch set. Meaning that no-one apart from root is allowed to execute programs from the mounted media. Centos 5 does it, so RHEL5 would do it too. OpenSuse10.3 doesn't do it; Fedora 8 does; Debian 4 does.
    If your distro uses an old-fashioned fstab (Debian 4 does, for example), you could edit that and stick an explicit 'exec' switch in as one of the mount options (plain old "user", commonly specified, implies "noexec").
    But RHEL5 and Fedora 8, for example, use a new udev-magic way of dynamically mounting removable media, so there's nothing listed in /etc/fstab until after a cd or dvd has been automounted... and by that stage, it's too late to edit what the mount options should be!
    The fix for these sorts of distros is to become root and manually unmount any Oracle CDs or DVDs that have been automounted. You can then simply re-mount them by issuing a command such as
    mount -o loop /dev/cdrom /media...and, because this manual mount doesn't include explicit noexec switches, you'll find that if you now become the oracle user, you'll be allowed to execute the runInstaller program normally.

  • -bash: ./runInstaller: /bin/sh: bad interpreter: permission denied

    I have done all pre requisite configurations in Enterprise Linux R5 for the installation of Oracle Database 10g R2. When I run this ./runInstaller command from terminal window of Oracle user account. I got following error.
    -bash: ./runInstaller: /bin/sh: bad interpreter: permission denied
    Kindly send me the solution of this problem on urgent basis.
    Thanks.
    Shahzad

    ls -la runInstaller
    Check permission, that user can run.(execute)
    By the way, if you use "oracle" user rune it...
    Please Extract Oracle Source by oracle user.
    Or user root user and change permission source ...
    root$ cd SOURCE
    root $ ls -la runInstaller
    root$ chown -R oracle:oinstall .
    example:
    $ cd Disk1/
    $ ls -la runInstaller
    -rwxr-xr-x 1 oracle oinstall 1756 Mar 12 2008 runInstaller

  • Bug? in /usr/xpg4/bin/grep - Solaris 7_x86

    Hi Everyone,
    I wonder if anyone has encountered this on before.
    /usr/xpg4/bin/grep -x patto test
    where test contains patto
    If you then check the error result is always returns an exit code of 1
    Only when the string contains 5 characters!
    Is there a patch available?
    Cheers
    Chris.

    I am getting in this
    ERROR: content verification of </usr/bin/bash> failed
        unable to fix modification time
        file size <794472> expected <794248> actual
        file cksum <39353> expected <18006> actual
    and this
    pkgadd: ERROR: unable to create package object </usr>.
        unable to fix attributes
    ERROR: content verification of </usr/bin/bash> failed
        unable to fix modification time
        file size <794472> expected <732556> actual
        file cksum <39353> expected <45034> actual
    pkgadd: ERROR: unable to create package object </usr/bin/rbash>.
        pathname does not exist
        unable to create symbolic link to <./bash>
    ERROR: attribute verification of </usr> failed
        unable to fix attributes
    ERROR: attribute verification of </usr/bin/rbash> failed
        pathname does not exist
        unable to create symbolic link to <./bash>
    but works fine in other systems
    patchadd 126546-06
    Solaris Sparc 10 32 bit

  • /usr/bin/bash[34]: syntax error at line 40 : `set' unexpected

    Hi All
    I would like to install Oracle Database 11gR1 On Solaris 10
    When I run root.sh command, I confused to input path
    *# cd /home/oracle11/app/oracle11/product/11.1.0/db_1*
    *# ./root.sh*
    Running Oracle 11g root.sh script...
    The following environment variables are set as:
    ORACLE_OWNER= oracle11
    ORACLE_HOME=  /usr2/home/oracle11/app/oracle11/product/11.1.0/db_1
    *Enter the full pathname of the local bin directory: [usr/local/bin]:/usr/bin/bash*
    I have inputed "/usr/bin/bash"
    Now I can not run bash on Solaris 10.
    *# bash*
    bash[34]: syntax error at line 40 : `set' unexpected
    Please help me!
    Thankyou and best regards,
    thiensu2810

    Hi
    Output of "$ find /usr -name bash 2>/dev/null" is
    *# find /usr -name bash 2>/dev/null*
    */usr/bin/bash*
    *# less /usr/bin/bash*
    +###################################+
    +#+
    +# $Header: coraenv.sh 17-may-2007.08:31:33 jboyce Exp $ coraenv+
    +#+
    +# Copyright (c) 1987, 2007, Oracle. All rights reserved.+
    +#+
    +# This routine is used to condition a C shell user's environment+
    +# for access to an ORACLE database. It should be installed in+
    +# the system local bin directory.+
    +#+
    +# The user will be prompted for the database SID, unless the variable+
    +# ORAENV_ASK is set to NO, in which case the current value of ORACLE_SID+
    +# is used.+
    +# An asterisk '*' can be used to refer to the NULL SID.+
    +#+
    +# 'dbhome' is called to locate ORACLE_HOME for the SID. If+
    +# ORACLE_HOME cannot be located, the user will be prompted for it also.+
    +# The following environment variables are set:+
    +#+
    +# ORACLE_SID Oracle system identifier+
    +# ORACLE_HOME Top level directory of the Oracle system hierarchy+
    +# PATH Old ORACLE_HOME/bin removed, new one added+
    +# ORACLE_BASE Top level directory for storing data files and+
    +..................................+
    +.................................+
    else
    if (-e $ORABASE_EXEC) then
    if (-x $ORABASE_EXEC) then
    set BASEVAL=`$ORABASE_EXEC`
    setenv ORACLE_BASE $BASEVAL
    echo "The Oracle base for ORACLE_HOME=$ORACLE_HOME is $ORACLE_BASE"
    else
    echo "The $ORACLE_HOME/bin/orabase binary does not have execute privile
    ge"
    echo "for the current user, $USER.  Rerun the script after changing"
    echo "the permission of the mentioned executable."
    endif
    else
    setenv ORACLE_BASE $ORACLE_HOME
    echo "The Oracle base for ORACLE_HOME=$ORACLE_HOME is $ORACLE_BASE"
    endif
    endif
    +#+
    +# Install local modifications here+
    +#+
    thank,
    thiensu2810

  • Dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

    After upgrading to ML, I am now getting this message when I try to sudo.  I've repaired permissions, rebuilt the dyld cache, and removed the DYLD_LIBRARY_PATH environment variable, all with no success.  Met with this message each time:
    $ sudo ls
    dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
    Password:
    Any help is appreciated.
    Thanks!

    In short, I find this solution:
         comment out `export LD_LIBRARY_PATH=XXX` in .bash_profile
    I do not have DYLD_LIBRARY_PATH in bash env

Maybe you are looking for

  • Filesystem supported by Mac OS X and Linux

    I got Windows, Linux and Mac OS X on my system. I'd like to share files on a partition that Linux and Mac OS X can access, but not Windows. So far I've used FAT32, but obviously Windows can access that, so I'm looking for something else. Is there any

  • Settings to set default Output Device in FPCJ

    Hi, System is taking LP01 as default Output Device instead of the custom made Output device(ZLOCL) while executing the Z smartforms using transaction FPCJ. In user setting I have defaulted ZLOCL as default output device & desired page format type is

  • BAI SWIFT,  bank key , file processing question

    Current setup: System has Bank key 12345, Bank number 12345 setup. No SWIFT code BAI file has SWIFT key "CITIBRBR" for Citibank in 02 header EBS my bank account number "5555555" is tied to Bank key "12345" Statement processing works successfully Futu

  • Does apple provide service and repairs internationally?

    I am presently in the US and about to purchase iPhone 5s in the coming week. In November I am moving to India for some work. After going through the apple communities I have found that Apple is not providing international warranty. So if that's the c

  • Tabstrip in Theme Editor

    Hi all - I'll try to explain this the best I can......within the theme editor, I'm attempting to create tabs that are one uniform color.  Somehow, I've created 2-tone colored tabs.  The 'Background Color of Selected Tab' is one color (which I've inte