Terminal troubles. Command not found error in the directory of the command.

I'm getting a "command not found" error when I am in the directory of the command I want to run. For example try to run 'mysql' in the directory with that executable file and I get the error. BUT, if I put the full path to the mysql command, starting from the root, the command works correctly.
I know this isn't a PATH issue, since I'm in the location of the file.
It seems like a possible permissions issue, but I appear to have the proper permissions to the command and all parent directories. Moreover, I would assume that I would see a "permissions denied" error rather than a "command not found" error if this was the case.
Beyond the two possibilities above, I'm stumped as to what the issue could be. To be clear, this is happening on more than one command, although both commands are within the /usr/local/ directory.
Any help would be greatly appreciated!!! Thanks in advance!

By default . is not included in your PATH and the shell does not do this on its own, as that is an easy way for someone to get a user to execute a Trojan.
For example, in a multi-user system you create a script 'ls' and put it in a directory with a bunch of other stuff. Then go over to a user on the same system and ask them to help you with something in this directory. The first thing they will do is issue the 'ls' command, which if you have . in your PATH, or the shell always looks in the current working directory, means this user would execute the Trojan script instead of the real 'ls' command. That script do do anything using the privileges of the user running that script, including modifying stuff in their home directory that could give the person asking for help future access to that user's files and data.
That is why . (the current working directory) is NOT part of PATH by default and shells do not look in the current working directory by default.

Similar Messages

  • Command not found error while executing shell programs in terminal

    I have written one sample shell program.
    while executing shell program in terminal,it shows COMMAND NOT FOUND error.
    How to slove this.

    Post the "Actual" error.  It says more than command not found.
    Post your script.
    Post the output from:
    echo $PATH
    Post the output from:
    which name_of_command_not_found

  • Aerender CC 2014 returns "command not found" error on Mac 10.9.3?

    Well, that about sums it up. I'm trying to run aerender in Terminal and I just get a command not found error.
    Here's the batch script: "aerender -project /Volumes/xxx/After_Effects_Templates/xxx.aep -comp "Final_Web_800x600" -OMtemplate 800x600 H.264-output /Volumes/xxx/Renders/rendertest.mov"
    Anyone know what I'm doing wrong?
    Many thanks in advance.
    Bettsy

    Hi wsrphoto,
    You need to follow these steps.
    1. Launch creative cloud application.
    2. Go to Preferences and go to Account tab.
    3. Sign out from there and then quit creative cloud application.
    4. Launch Creative cloud again and log-in back again
    5. Then download and install the product.
    Please revert if you still face any issue.

  • Shell Commands not found error when running application

    Hello,
    Im using MonoDevelop IDE in my Mac, before it used to work fine but after few days, now when I'm opening the application nothing happens., i checked the Console  for the log and it says this
    May  9 21:29:39 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x52052].com.ximian.monodevelop[1510]: /Applications/MonoDevelop.app/Contents/MacOS/monodevelop: line 17: dirname: command not found 
    May  9 21:29:39 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x52052].com.ximian.monodevelop[1510]: /Applications/MonoDevelop.app/Contents/MacOS/monodevelop: line 31: //mono-version-check: No such file or directory
    May  9 21:29:39 Sri-Vishnu-Totakuras-MacBook-Pro com.apple.launchd.peruser.501[599] ([0x0-0x52052].com.ximian.monodevelop[1510]): Exited with code: 1
    I thought may be some error with the "dirname" command, so i commented it in the code and gave the path of directory myself and then the console shows up like this.
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: /Applications/MonoDevelop.app/Contents/MacOS//mono-version-check: line 19: grep: command not found 
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: /Applications/MonoDevelop.app/Contents/MacOS//mono-version-check: line 19: cut: command not found
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: /Applications/MonoDevelop.app/Contents/MacOS//mono-version-check: line 20: cut: command not found
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: /Applications/MonoDevelop.app/Contents/MacOS//mono-version-check: line 21: cut: command not found
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: /Applications/MonoDevelop.app/Contents/MacOS//mono-version-check: line 22: cut: command not found
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: /Applications/MonoDevelop.app/Contents/MacOS//mono-version-check: line 31: osascript: command not found
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: Cannot launch MonoDevelop
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro [0x0-0x56056].com.ximian.monodevelop[1532]: MonoDevelop requires the Mono Framework version 2.10.4 or later.
    May  9 21:34:12 Sri-Vishnu-Totakuras-MacBook-Pro com.apple.launchd.peruser.501[599] ([0x0-0x56056].com.ximian.monodevelop[1532]): Exited with code: 1
    I opened the contents of the application and run the shell script for opening aplication there it worked very fine and application started working.. But if i open application directly through launchpad or finder it doesnt show up and console
    I tried running those commands in the terminal directly there they work.. But dunno whats wrong in here. and even if try to open the application through the terminal it all opens fine.. what could be the possible problem, is it with my mac..?

    i finally figured out the problem.. it is with the environmental variables.  the path for all those commands like "grep" is not being set for the GUI applications.  that is why i got that error. 
    for those GUI applications which require path, we have to set path in the file /etc/launchd.conf  the environmental variables set in here are used by the gui applications and those which are launched through spotlight.
    that file may bot be present in most of the macs. No problem even if not present,we can create one and use.
    so  type in terminal
              $ sudo vi /etc/launchd.conf     
    and in the editor add these lines
              setenv PATH = /new/path
    and save.  Note: replace /new/path with the path which you need to have for the commands used in the script.
    remeber that you need to restart your mac for applications to use these environmental variables.

  • Command not found error in Linux

    Hi all,
    While login into Linux server using terminal i am getting following error.
    -bash: /usr/bin/id: No such file or directory
    -bash: [: =: unary operator expected
    While execute these commands getting following errors
    # clear
    -bash: clear: command not found
    # du -sh *
    -bash: du: command not found
    Help on these issues.
    Linux 32bit OS.
    Red Hat Enterprise Linux Server release 4.0 (Tikanga)

    Likely a flaky environment.
    What is the contents of .bash_profile in your $HOME?
    Any btw, why RHEL4? It is ancient.

  • HELP! Installer_Script_Springboard__: line 13: s: command not found ERROR

    got this error in the Installer log while using the upgrading option to Leopard. After that the installation just stalled and did not move. I have tried more than a few times. and same results. Can ANYONE PLEASE HELP ? Below is the error message
    Oct 27 05:48:23 localhost runner150: _Installer_Script_Springboard_163: /Volumes/Reddy`s HD/private/tmp/scripts.VaIV/_Installer_Script_Springboard_: line 13: s: command not found
    Oct 27 05:48:23 localhost runner150: _Installer_Script_Springboard_163:
    Oct 27 05:56:19 localhost Unknown67: 2007-10-27 05:56 Mac OS X Installer143 (CarbonCore.framework) FSEventStreamStart: ERROR: FSEvents_connect() => Unknown service name (1102)
    Oct 27 05:56:21 localhost OSInstaller143: installAutoFSMonitor: open failed

    Hi!
    After 6 hours of experimenting, disconnecting devices, formatting my hard drive (joy!) and getting nowhere, I found the problem: apparently, Leopard has trouble dealing with some characters in the volume name (in my case it was '). Rename the volume to something simple, short and with no weird characters and the Leopard will install.
    And, to Apple: I'm very disappointed with the quality of the Leopard install. If a character is valid in OS X, the setup should support it!
    Best regards,
    IYan

  • Command not found error while executing a shell script

    Hello,
    I am a newbie to linux.I am attaching the code which gives me following errors..
    error list:
    1. no such file or directory enviornemnt
    2. command not found
    3. ambiguous redirectline
    Script
    cd $HOME/wkdir
    rm /tmp/*.log
    # source environment
    . ./env
    # Run the install script to setup the database
    # Configure SH account
    sqlplus "/ as sysdba" <<! > /tmp/perflab_install.log 2>&1
    grant connect, resource, dba to SH;
    alter user sh account unlock;
    # create the fetch_n_rows procedure
    sqlplus "$PERFLAB_USER" <<! >> /tmp/perflab_install.log 2>&1
    drop index sales_time_bix;
    drop index sales_time_idx;
    create index sales_time_idx on sales(time_id) compute statistics;
    -- fetch_n_rows: fetches 'n' rows from the specified statement --
    CREATE OR REPLACE PROCEDURE fetch_n_rows(
    stmt VARCHAR,
    name VARCHAR,
    nexec NUMBER := 1,
    nrows NUMBER := 0,
    debug BOOLEAN := FALSE)
    IS
    -- Local variables
    curs INTEGER := null;
    rc INTEGER;
    nexec_it INTEGER := 0;
    nrows_it INTEGER;
    BEGIN
    dbms_application_info.set_module('DEMO', name);
    WHILE (nexec_it < nexec)
    LOOP
    curs := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(curs, stmt, DBMS_SQL.NATIVE);
    rc := DBMS_SQL.EXECUTE(curs);
    nrows_it := 0;
    LOOP
    IF (dbms_sql.fetch_rows(curs) <= 0 OR (nrows <> 0 AND nrows_it = nrows
    THEN
    EXIT;
    ELSE IF (debug = TRUE)
    THEN
    DBMS_OUTPUT.PUT_LINE(nrows_it);
    END IF;
    END IF;
    nrows_it := nrows_it + 1;
    END LOOP;
    DBMS_SQL.CLOSE_CURSOR(curs);
    nexec_it := nexec_it + 1;
    END LOOP;
    dbms_application_info.set_module(null, null);
    END fetch_n_rows;
    show errors
    # Start the workload
    . ./start_workload.sh > /tmp/setup_perflab.log 2>&1
    # Wait two minutes for workload to get going
    sleep 120
    # Modify snapshot interval
    sqlplus -s /NOLOG <<EOF >> /tmp/setup_perflab.log 2>&1
    connect / as sysdba
    set head on
    set feedback on;
    set pagesize 40
    rem -- event to allow setting very short Flushing interval
    alter session set events '13508 trace name context forever, level 1';
    rem -- change INTERVAL setting to 2 minutes
    rem -- change RETENTION setting to 6 hours (total of 180 snapshots)
    execute dbms_workload_repository.modify_snapshot_settings(interval => 2,-
    retention => 360);
    EOF
    Note : start_workload.sh is also in the same directory..
    Any help would be greatly appreciated.

    Please put your script between "code" format delimiters.
    http://wiki.oracle.com/page/Oracle+Discussion+Forums+FAQ
    You can add the line "set -x" at the beginning of your script to see at which line it fails? I suspect the . ./env line.

  • File not found error on some computers running the same program

    Dim pList As System.Diagnostics.Process
    retval = 0
    PTRName = "F:\myprogram.exe"
    If My.Computer.FileSystem.FileExists(PTRName) Then
    System.Disgnostics.Process.Start(PTRName)
    pList = System.Diagnostics.Process.GetProcesses
    For each proc As System.Diagnostice.Process in pList
    If proc.ProcessName = "myprogram" Then
    retval = proc.Id
    Exit For
    End If
    Next
    If retval > 0 then
    'continue
    Else
    'error message
    End If
    End If
    PTRName = "F:\myprogram.exe"
    If My.Computer.FileSystem.FileExists(PTRName) Then
    Retval = Shell(PTRName,4)
    If Retval > 0 Then
    'Continue
    Else
    'Error message
    End If
    End IF
    I have created a program which:
    opens a file
    reads the records and massages the records
    writes the records to a new file
    Launches a program that uses the resultant file.
    The program was written on Windows xp MCE using Visual Studio 10. The resulting program works fine.
    I places The executable and the input file onto a flashdrive, and then tested it on other machines.
    Two of the machines are both Win 7 Pro 64bit with .Net 4. On one machine it works great. On the other I get a "File not found" error when starting the second process. This is the failing code:
    The problem is with the Shell command. When I rewrite it as:
    it works on both machines
    So my question is: Why does exactly the same code (The same flashdrive was used on both machines) work on one machine and not the other (when both machenes appear to be at the same level)?
    In both cases I verify the file exists in the correct place before I try to start it.
    Any help would be appreciated.
    Thanks in advance
       John 

    The use of F is just an example. I use:
    OutputPath = My.Application.Info.DirectoryPath 'Where app is run from (root)
        'Make sure the path ends in \
        If VB.Right(OutputPath, 1) <> "\" Then
          OutputPath = OutputPath & "\"
        End If
    to get the correct information.
    Then
      PTRName = OutputPath & "myprogram.exe"
    BTW "myprogram.exe" is not the correct name it is just an example.
    Sorry if this caused confusion
    However all of this is not the point. If:
     My.Computer.FileSystem.FileExists(PTRName)
    is true then the file is in the right place. Therefore:
    Retval = Shell(PTRName,4)
    must also work. However it does not on some machines.
    Is the problem in .Net, VB or VS because it is not in my code. 
    I have also used a routine similar to you (in VB6) to find a particular volume, but used the volume label. That worked better in my case.
    John

  • Spool Command not found error

    Dear friends,
    I am trying to get the list of active and inactive sessions for some users and created a script for this but getting some error message.
    Could you please check why I am getting this error while running from the putty. The same sql command I run from sql developer and get the output with no errors.
    Script:
    set pagesize 0
    set feedback off
    set echo off
    sqlplus '/as sysdba'
    spool kill_session_list.sql;
    select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';'
    from v$session
    where type!='BACKGROUND'
    and username in('RO_USER','KHALIED','INFAREP','DAC','DMUSER_PROD','LAND_PROD','STAGE_PROD','BIUSER_PROD','OLAPDW','DWRO');
    spool off;
    exit
    Error msg:
    ./kill_session_generate.sql: line 5: spool: command not found
    ./kill_session_generate.sql: line 6: syntax error near unexpected token `||'
    ./kill_session_generate.sql: line 6: `select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';''
    Thanks.

    877938 wrote:
    Dear friends,
    I am trying to get the list of active and inactive sessions for some users and created a script for this but getting some error message.
    ./kill_session_generate.sql: line 5: spool: command not found
    ./kill_session_generate.sql: line 6: syntax error near unexpected token `||'
    ./kill_session_generate.sql: line 6: `select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''';''Odd.
    Look at the script kill_session_generate.sql very carefully, especially the lines before and after the SPOOL command as well as the spool command itself. Consider deleting and retyping the line with the SPOOL command in case invisible special characters are causing problems
    Good luck!

  • TS1544 "keychain not found" error messages pop up all the time, please help!

    Hi, Ive been constantly getting "keychain not found" error messages ever since i updated to OS X and cant sync messages, facetime, calendars etc. i've tried keychain first aid and get this message:
    Verification started
    Checking keychain configuration for Lee (user ID=501)
    Home directory is /Users/Lee
    Checked login keychain
    Error: login keychain not found
    Unable to get info for ~/Library/Keychains/login.keychain, reason: The operation couldn’t be completed. No such file or directory
    Checked default keychain
    Checked keychain search list
    Problems were found; you should choose the Repair option to fix them
    Verification failed
    Can anyone help?
    Thanks

    Is there a login.keychain in /Users/username/Library/Keychains/? The message says not. If not, create a new one or restore the one residing in your bootable backup/clone or Time  Machine backup.

  • Make, Make install - Command not found. How do I get these commands working

    Hi guys!
    I am trying to compile the php using the command ./configure and make, make install but every time I try to use the comand "make" it says "command not found". Do you know how can I install these bibliotec?
    Thanks in advance.
    Felipe Moreira.

    Hi Felipe, Welcome to Apple's Users Help Users Forums.
    Glad you got it solved.
    Thanks in Apple Forums is through the Stars system. See the blue box at the top of the thread as well as the Apple emails re new posts to the thread.
    With the buttons just to the left of "Reply" for the OP = Original Poster.
    1 Green Solved available. 10 pts.
    2 Gold Helpful available. 5 pts.
    Mark the buttons at the appropriate post. (Not this one. ;~) )
    Joyous Computing, JP

  • Command not found error

    I'm trying to run this command in my terminal:
    sudo ./cloudera-manager-installer.bin
    however, it is saying that such a command is not found... I've tried also inputting the actual path to the object as such:
    sudo ./cloudera-manager-installer.bin
    and have gotten the same error messsage. Any feedback would be greatly appreciated!

    The second command is the same as the first. It will work only if there is an executable named "cloudera-manager-installer.bin" in the current directory. If there isn't, change to the directory or use the full path.

  • [SOLVED] /bin/bash: endif: command not found ERROR while saving in vim

    My .vimrc file
    set expandtab
    set number
    syntax on
    set autoindent shiftwidth=4
    set smartindent
    set tabstop=4
    set smartcase
    colorscheme elflord
    set incsearch
    set hlsearch
    au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
    " Tell vim to remember certain things when we exit
    " '10 : marks will be remembered for up to 10 previously edited files
    " "100 : will save up to 100 lines for each register
    " :20 : up to 20 lines of command-line history will be remembered
    " % : saves and restores the buffer list
    " n... : where to save the viminfo files
    set viminfo='10,\"100,:20,%,n~/.viminfo
    function! ResCur()
    if line("'\"") <= line("$")
    normal! g`"
    return 1
    endif
    endfunction
    augroup resCur
    autocmd!
    autocmd BufWinEnter * call ResCur()
    augroup END
    On some files, I get this error http://i.imgur.com/lKFvm.png at the bottom of vim . Please note that I get the error not on all files. Its driving me crazy!
    Last edited by shadyabhi (2011-09-11 02:41:52)

    Replace this:
    au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
    with this:
    au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent execute "!chmod a+x <afile>" | endif | endif
    If the above doesn't work for you (though it should in Vim > 7), try a different way of doing the same thing:
    function ModeChange()
    if getline(1) =~ "^#!"
    if getline(1) =~ "/bin/"
    silent !chmod a+x <afile>
    endif
    endif
    endfunction
    au BufWritePost * call ModeChange()
    Last edited by bohoomil (2011-09-11 02:29:58)

  • Getting "HP imaging device not found" error when trying to use the scanner in mountain lion. Anyone else have this problem?

    The odd thing is the printer works, but the scanner isn't recognized.
    I ran the latest Mac software update first, and then reinstalled the HP software. I checked all the settings as suggested from the HP site, but nothing seems to work.
    Has anyone had this problem and found a solution?
    Thanks
    Steven

    The odd thing is the printer works, but the scanner isn't recognized.
    I ran the latest Mac software update first, and then reinstalled the HP software. I checked all the settings as suggested from the HP site, but nothing seems to work.
    Has anyone had this problem and found a solution?
    Thanks
    Steven

  • Terminal Returns Not Found Error for Most Commands

    Hi all,
    I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. Having done so, I typed in "sudo port install wine" minus the quotes, the terminal returned a not found error. I tried other basic commands like say and clear and all of them return the not found error. I've googled this and all I've understood so far is that the PATH might be incorrectly set. So I ran this command: echo $PATH and it returned this: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin
    Can anyone tell me how to set this path correctly? I'm a complete newbie to mac and have no idea where .bash_profile or any of those files are. If it helps, I've also installed xCode and the Command Line tools for xCode. I'm running Mountain Lion.
    PS: I tried export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin  but it only works as long as I keep the terminal window open. If I close it and open it again, it goes back to the same problem.
    Thanks in advance,
    Jack

    Some time in your past, your or a script modified your shell initialization file.  Most likely related to installing MacPorts.
    Look in your home directory for one of the following files:
    /bin/ls .bash_profile
    /bin/ls .bash_login
    /bin/ls .profile
    /bin/ls .bashrc
    One of them will have your current export PATH.
    Using nano, edit the file wtih your export PATH to include the additional search directories.  It would be best to put the missing search directories at the beginning of the list with the /opt/... directories from MacPorts at the end.
    /usr/bin/nano .name.of.shell.initialization.script.that.has.the.export.PATH

Maybe you are looking for

  • Installation problem for Java EE 5 SDK Update 2

    Hi , I have jdk1.5.0_12 (J2SE) installed on my Windows XP. Now i am trying to install J2EE on my machine.I tried to install it twice but it comes to a halt after completing 45% at the same jar file. Following is the link which shows it comes to a hal

  • Sql query required

    Hi All, I've two tables Institute and Employee . Institute intId name 1 XYZ 2 ABC Employee empId emplyName intId deptId          desc 1     X          1 1          xx 2     Y          1 1          xx 3     A          2 2          YY 4     B          

  • How to Create one TLB Order manually with multiple deployed STR's

    Hello, We are currently facing an issue when trying to make a TLB manually by right clicking on the deployed STR's. APO generates multiple orders for each item. Business requirement is to generate one TLB Order.    For example there are 10 Confirmed

  • Updating Flash - 'error has been encountered' and exe file vanishes

    On an Aspire one netbook that I've not used for some time, so loads was out of date. I've just updated firefox, and that was fine. But I keep getting warning messages about adobe flash being out of date and vulnerable, so have tried to update that to

  • Add valuation type in access sequence

    Hi, i like to add valuation type in access sequence JST1 which is belongs to access sequence for taxinn, i want  material/plant/vendor/valuation type cominiation table plese help me is there any othe way to add field in field catalogue of taxinn, is