Automtor shell script "command not found"

I want to include the execution of a shell script in Automator. The script just executes a third-party application (actually, pdftk) with certain parameters. I have written the script, saved it in my Home directory as "foo.sh", made it executable, and can correctly call it from Terminal with ./foo.sh. It works as expected.
But if I include it in Automator's workflow, into action "Run shell script", its execution breaks complaining that "pdftk: command not found". This indicates that the script is correctly found and read by Automator. How is it, that Terminal's bash can find the command, but Automator doesn't ? Have commands to be written in a special way to be understood by Automator ? Perhaps third-party commands are not allowed in Automator ?

As twtwtw has said, you environment when running Automator is NOT the same as when you are in a Terminal session.
pwd:
/Users/harris
/bin/ls -dlaeO@ .
drwxr-xr-x  349 harris  harris  - 11866 Mar 14 22:06 .
id -a:  uid=501(harris)
gid=501(harris)
groups=501(harris),
204(_developer),
100(_lpoperator),
98(_lpadmin),
80(admin),
61(localaccounts),
12(everyone)
$# 0
printenv: SHELL=/bin/bash
TMPDIR=/var/folders/zv/zvU6+bMiHTeElG+JIWOdzk+++TI/-Tmp-/
Apple_PubSub_Socket_Render=/tmp/launch-rVMvHQ/Render
USER=harris
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-fH4Gt7/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PATH=/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/harris
DBUS_LAUNCHD_SESSION_BUS_SOCKET=/tmp/launch-RIPIu6/unix_domain_listener
SHLVL=1
HOME=/Users/harris
LOGNAME=harris
DISPLAY=/tmp/launch-ttdbVO/org.x:0
FRED=3-Mar-2009
_=/usr/bin/printenv

Similar Messages

  • 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.

  • 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 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

  • Executing CR HOST script, encountering command not found

    Hi All,
    I new to writing Host scripts, especially for use within the Applications.
    I need to go out to an FTP site and grab a file.
    The FTP portion of the script works fine.
    The problem I'm encountering is with the execution of regular commands like 'cd' or 'mv'.
    The error comes back, ...line xx: cd: command not found
    When I have an actual directory path with the cd command - I always get, No such file or directory...
    (I have verified the directory paths I'm attempting to change to exist and available.)
    The FTP portion executes, but the received file goes into some obscure server directory. Can't even perform a move of the file.
    The echo command works fine.
    I have created just a dummy script to do a cd /u32/... command and still the same Error.
    Any suggestions will be very helpful.
    Thanks,
    Bradley

    Here is a main code script....
    #$HEADER: XX_BANK_STMTS_IMPORT
    # PROGRAM NAME: XX_BANK_STMTS_IMPORT
    # PURPOSE:
    # Load XXXX Bank Statements
    # XX Bank Statements Import Concurrent Program
    # This script requires to run as Concurrent Request
    P_LOGIN="$1"
    P_USER_ID="$3"
    P_REQUEST_ID="$4"
    REMOTE_USER=ftpuser
    REMOTE_PASSWD=ftpuser
    FTP_DIR=u32/oracle/DBCTEST/apps/apps_st/xxcust/12.0.0/ftp/inbound
    REMOTE_PATH=public/dbco_cng/reporting
    REMOTE_FILE=*.PGP
    echo "USER = "${USER}
    echo "HOST = "${HOSTNAME}
    echo "Directory = "${PWD}
    cd /u32/oracle/XXXTEST/apps/apps_st/appl/xxcust/12.0.0/ftp/inbound
    echo "Directory = "${PWD}
    echo " Transferring File"
    ftp -n -i -v <<-EOF
    open XX.XX.XXX.XXX
    user $REMOTE_USER $REMOTE_PASSWD
    ##lcd $FTP_DIR
    cd $REMOTE_PATH
    mget $REMOTE_FILE
    EOF
    I get errors like
    /u32/oracle/XXXTEST/apps/apps_st/appl/xxcust/12.0.0/bin/XX_BANKFILE_LOAD.prog: line 108: cd: /u32/oracle/XXXTEST/apps/apps_st/appl/xxcust/12.0.0/ftp/inbound
    : No such file or directory
    or if I just put the cd command:
    cd: commad not found
    The commented out lcd was from previous tries at doing it that way... No luck.
    Thanks.

  • 'java_wrapper: command not found'  when running license script

    Hello, am trying to run a third party application licensing script which needs JRE to run. This script is failing with the following error. 'java_wrapper: command not found' ...
    Can anyone assist with ideas of resolution?! Does a path need to be set? Does JRE (1.4.1_x) need to live in a specific part of the unix filesystem (solaris 8)?!
    Thanks!!

    This is not a TNS names issue if you can connect to database. It could be a network problem, but more likely it's a problem with the installation of the app server. When you install the app server, it should use the name assigned to the server. I don't believe you can just make up a name for an app server unless it is known to the network.

  • Crontab "Desktop: command not found"

    This is my first attempt to use crontab. I have a working shell script, humassetsmonupload, in my /Users/Shared/ directory that when I run it without arguments, it does as expected.
    I've made my first edit in crontab by adding this line:
    */10 * * * * * /Users/Shared/humassetsmonupload
    According to my system mail messages, crontab is alerting me every ten minutes about it. But all messages say this:
    /bin/sh: Desktop: command not found
    The shebang matches it. The environment is correct it appears. But "Desktop" throws me. The shell script does not have this word in it. What am I overlooking?, sam

    1st, you have too many * in your "When to Run" section. There are ONLY 5 fields. You have 6.
    So that 6th field is actually treated as the first word of your command to execute. So you are trying to execute:
    * /Users/Shared/humassetsmonupload
    as your command. The * is going to list every file in your home directory, and if Desktop is the first name listed, then the shell is going to try and execute the command Desktop.
    2nd, another thing to keep in mind. You do not have your full set of environment variables when running via cron.
    It is useful to run a cron job that does a printenv
    */10 * * * * printenv >/tmp/cron.printenv
    after you have your list of cron available environment variables, you can remote the printenv entry.

  • -bash:  cat: command not found (or grep)

    Hi, Strange things:
    i3: okn$ ls -R | grep -h "dof" | cat > dtext.txt
    -bash:  cat: command not found
    or then I get this:
    i3: okn$ find . -type f -print | grep -c
    -bash:  grep: command not found
    but this is not happening all the time, i remember grep or cat did work once or twice...
    What's going on here?
    OS 10.7.4; repaired permissions
    Any assistance much appreciated!
    / bw, Omar KN

    'cat' is stored in /bin/cat, NOT /usr/bin/cat, which explains the file not found messages above.
    HOWEVER, the information you have provided seems to imply you have the executables, and previous information provides says you have a valid PATH:
    echo $PATH
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/bin:/bin:/usr/sbi n:/sbin:/usr/local/bin:/usr/X11/bin
    this creates a mystery as to why you are getting:
    -bash:  cat: command not found
    -bash:  grep: command not found
    I have a couple of thoughts.
    a) I'm wondering if you have any 'alias' statements in your .bash_profile (or .bash_login, or .profile, or .bashrc).
    b) if you would get the same results should you rename your .bash_profile (and/or .bash_login, .profile, .bashrc) to something like saved.bash_profile, then restart your terminal session (basically eliminating any personalized shell customization).
    c) what would happen if you created a new account (System Preferences -> Accounts) - basically a clean starting point.
    d) are you executing these commands from the command prompt?  Or from within a shell script?
    d.1) if from within a shell script, is the script file the correct file format.
    file name.shell.script
    you want to check that the output from the 'file' command DOES NOT say "...with CRLF line terminators...", as that would imply the the file came from (or through) a Windows system.

  • Bash: adb: command not found.

    I installed ADT bundle from Google.
    I navigated to
    ~/adt-bundle-linux-x86_64-20130219/sdk/platform-tools
    I tried to start adb and got.
    bash: adb: command not found.
    Grrrrr. Had this issue on Debian half a year before. Installed ia32-libs back-then. It worked.
    Arch has no ia32-libs. Uncommented multilib and installed
    lib32-gcc-libs-4.8.0-2 lib32-glibc-2.17-5 lib32-libstdc++5-3.3.6-6 lib32-ncurses-5.9-2
    Like suggested in the forum. No change. Adb is still not found.
    Any help?
    Last edited by manuelschneid3r (2013-04-22 18:21:58)

    manuelschneid3r wrote:
    I tried a lot distros, but I still would not call me an advanced user. I dont know exactly the dfference but ./foo runs something that has rights to be executed. Yes I called it in the right directory. Its a linking problem. (See here)
    I installed the dependencies of android from AUR. Now it works but it shows ??????????? as device...
    Incredibly sick, that Android SDK is not in the official repos...
    The "????????????" means that you do not have the correct udev rules setup. There's an adb udev rules package to install to get around having to write your own.
    And no, `./script.sh` executes something in the present working directory. It is equivalent to:
    $ $SHELL $(pwd)/script.sh
    All the best,
    -HG

  • Compile smartmontools pkg from terminal: command not found

    hi there!
    when i comiple tar.gz packages i usally install it by this way:
      cd smartmontools-6.0
      ./configure
      make
      sudo make install
    everythink ok but when i prompt:
    smartctl /dev/disk1s2
    i see the error: command not found
    whats wrong? i googled it up and it seems that the command isnt in the system path but cant find to fix it!
    is a smartctl specific problem or after compiling/install am i missing something?
    thanks
    Enrico
    (osx: 10.8.2)

    Open Source installers DO NOT mess with individual user shell initialization scripts.  Open Source project may be installed on single user systems, or multi-user systems so to update every possible user's shell initialization files becomes a nightmare.   For example which accounts should be updated, and which are daemon accounts that should be left along.  Which shell does the user of each account prefer to use?  And for some shells, there are multiple different shell initialzation files, so which one does the shell initialzation file select.  And if the user already has a PATH environment variable in a shell initializaton file that gets executed AFTER the file the installer choose (.bash_profile vs .bashrc), then all the installers work would be for nothing, and worse confuse the user. And the user already has the directory in PATH, but they are not logged in, does the installer parse all the other user's shell initialzation files to figure out if that user does not need an update PATH, or does it blindly add yet another export PATH to one of the shell initialization files?
    Open Source installers worry about the getting the app built and installed.  It leaves the user's personal files alone, for very good reasons :-)

  • Which .bash does "do shell script" commands use?

    The "do shell script" command uses the Bourne shell "sh". But I am curious to know which .bash it uses to define the shell environment variables.
    I ran into a problem installing a third-party unix program which required new environment variables to be defined in order to execute. Defining these variables and executing this program from the terminal worked fine.
    But executing it within a "do shell script" command in an Applescript - the program died silently because the environment variables it required were not defined in the shell Applescript uses. It appears to invoke a new shell which does not inherit the environment variables defined in your home user shell.
    (I found this out by 'do shell script "set"' which listed the environment variables Applescript knows about - the ones I defined for the third-party program were not listed).
    A "brute force" way of fixing this is to pass the environment variables directly:
    do shell script "export THIRDPARTY_ENVVAR=blah; /usr/sbin/thirdpartyprogam"
    This works but not exactly elegant, particularly when you need to pass a number of variables.
    So - any better ways to do this? Can I edit the .bash Applescript uses, and where is it?
    Thanks.

    Another option that might work for you... if you are saving/distributing your AppleScript as an "Application bundler" is to group all your shell env. variables and other commands into a separate shell script file. Then include the shell script inside your app bundle. Locate the shell script at runtime and run that with "do shell script".
    For example, create "myShellScript.sh"
    #!/bin/sh
    export THIRDPARTY_ENVVAR=blah
    # ... more variable declarations..
    /usr/sbin/thirdpartyprogam
    # ... more shell commands...
    Store the shell script file inside your AppleScript bundle's Contents -> Resources folder (remember to make the shell script executable). Then your AppleScript can find your shell script at runtime and execute it like this:
    set ssPath to quoted form of POSIX path of (path to resource "myShellScript.sh")
    set stdout to do shell script ssPath
    Steve

  • Sudo: command not found

    OK, I got Jaguar installed and all updated on my trusty Wallstreet. the first time I installed it, something got messed up, and the desktop would not show up. So, I reinstalled, with a minmial install, then added in the BSD subsystem. I thought everything was fine, except the terminal would not display "welcome to Darwin!" when opened, instead, all I get is bash-2.05a$ when it starts up.
    So, when trying to run some shell scripts (to uninstall something), I typed in sudo and dragged the script to the terminal window, and pressed enter. all I got was: Sudo: command not found. So, I tried the old standby, su. it asked for my password (yes, I am running this from an admin account), and all it said was su: sorry. I know I am typing in my password correctly.
    the next step was to see where sudo is located, so i typed in
    which sudo
    and all I got was
    no sudo in /bin /sbin /usr/bin /usr/sbin
    so, from the looks of it, sudo was never installed. How am I supposed to get this back? reinstall the BSD subsystem, or is there some Quick and Dirty(tm) way to get it back?
    I am not afraid to play around in the terminal, as I am a Linux/unix junkie.
    thanks.
    -digital

    It's fixed. it was just a bad copy. I got another one, and now when I launch the terminal, it says
    Last login: Fri Mar 2 19:53:49 on ttyp1
    Welcome to Darwin!
    [Leo-Titus-LeBron-Vs-Computer:~] leolebron%
    and when I type sudo, it says:
    usage: sudo -V | -h | -L | -l | -v | -k | -K | [-H] [-P] [-S] [-b] [-p prompt]
    [-u username/#uid] -s | <command>
    So, it all works. I knew something was different, as right after running the setup assistant, it ran software update, which the other copy did not do.
    thanks for all the input.
    -digital

  • Command not found

    Hi everyone!
    Why would I get this error using "mv" in a do shell script?
    /bin/sh: line 1: mv: command not found (127)
    I should mention that I've only had this reported by one person to me...but any other users including myself never get this error. It's part of a Applescript Studio app...
    Thanks for the help,
    Reg

    Hi Reggie,
    For some reason, for this one user, the shell is unable to find the "mv" command on his machine (but I guess that's fairly obvious from the message he gets).
    The shell only looks for commands in specific directories that are listed in it's $PATH variable. Normally the mv command is found at /bin/mv and also normally the /bin directory is in the shell's $PATH. So...
    - this user's $PATH variable could be messed up or it could have been modified so that it no longer includes /bin. Typing in Terminal:
    <pre>
    echo $PATH
    </pre>
    will display the list of directories currently in the $PATH variable. This is what I get on my machine:
    /bin:/sbin:/usr/bin:/usr/sbin
    If /bin is not in the $PATH then the shell will not find /bin/mv.
    - it's possible that the mv command was somehow deleted from the user's machine. Typing
    <pre>
    which mv
    </pre>
    will tell you where the shell finds the mv command. Or if it's not found in any of the directories in $PATH then it will state that mv was not found and list the directories it looked in. For example:
    <pre>
    iMacHerman:~ steve$ which mv
    /bin/mv
    </pre>
    Or if I try with a command I know does not exist:
    <pre>
    iMacHerman:~ steve$ which mx
    no mx in /bin /sbin /usr/bin /usr/sbin
    </pre>
    Also: "ls -l /bin/mv" will tell you if mv is present in it's normal location. I get:
    <pre>
    iMacHerman:~ steve$ ls -l /bin/mv
    -r-xr-xr-x 1 root wheel 19060 Aug 17 00:22 /bin/mv
    </pre>
    - I suppose it's also possible that installing some open source or gnu libraries could have replaced the default "/bin/mv" command with a different version in a different location. But if so, this would be an indication that the new location has not been specified in the user's $PATH.
    Steve

  • [SOLVED] bash: $'\302\240grep': command not found [frequent CLI error]

    For the past several days I've been getting the following error frequently on the command line:
    bash: $'\302\240grep': command not found
    I think I'm only getting this error in response to commands that are piped to grep, such as the following:
    $ ps -ef | grep xyz
    or
    $ locate | grep abc
    However, I don't think I've gotten the error if I type the same commands as above, but without the space between '|' and 'grep'.  And, although the error is frequent, it doesn't happen every time; it is seemingly random.
    Anybody else experiencing this?  Any idea what might be causing it? 
    I'm using rxvt-unicode as my terminal.
    Jay
    Last edited by jt512 (2011-04-06 04:38:56)

    anonymous_user wrote:Post your ~/.bashrc
    # Check for an interactive session
    [ -z "$PS1" ] && return
    function timer () {
    at -f /home/jay/.timercmd now + $1 min
    function cpufs () {
    sudo cpufreq-set -c 0 $1 $2
    sudo cpufreq-set -c 1 $1 $2
    alias ls='ls --color'
    alias kc='~/scripts/kc.py'
    alias diff='colordiff'
    alias s2ram='sudo s2ram -f'
    alias grep='grep --color=always'
    alias Terminal='Terminal -T Terminal'
    alias emacsnw='emacs -nw -f menu-bar-mode'
    alias rm='rm -I'
    alias lpstd='lp -o "StpQuality=Standard"'
    alias paps='paps --paper letter --font="Courier 10"'
    alias mp='mplayer'
    alias mps='mplayer -softvol-max 600'
    alias mysql='$HOME/scripts/mysql'
    if [ $TERM = 'linux' -a $SHELL = '/bin/bash' ] ; then
    PS1='\033[?17;0;40c[\u@\h \W]\$ '
    else PS1='[ \[\e[0;32m\]\u@\h\[\e[m\] \[\e[0;31m\]\W\[\e[m\] \[\e[m\]]\[\e[0;32m\] \$ \[\e[m\]'
    fi
    eval `dircolors -b`
    # Allow tab completion for sudo'ed commands
    complete -cf sudo
    export PATH=$PATH:~/.local/usr/bin
    export EDITOR="vim"
    export BROWSER='conkeror:uzbl-browser:firefox'
    export GREP_COLOR="1;33"
    export LESS_TERMCAP_mb=$'\E[01;31m'
    export LESS_TERMCAP_md=$'\E[01;31m'
    export LESS_TERMCAP_me=$'\E[0m'
    export LESS_TERMCAP_se=$'\E[0m'
    export LESS_TERMCAP_so=$'\E[01;44;33m'
    export LESS_TERMCAP_ue=$'\E[0m'
    export LESS_TERMCAP_us=$'\E[01;32m'
    export SWEAVE_STYLEPATH_DEFAULT="TRUE"

  • 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.

Maybe you are looking for

  • My lock screen keeps freezing ios 7.1

    Hi guys, I want to know if I am alone in this issue or if it is widespread? Since updating my iphone 5 to ios 7.1 my lock screen freezes. Not all the time, mainly if there is a notification of a text etc. I have to turn the phone off and on and it so

  • Closed Lid Airport Performance

    My Sept 2011 MBA with lid closed sees 50% drop in Internet speed & performance. I don't this was the case a month ago but its easy to see now. Other computers on the home network (Airport) see 20 Mbps download speed. So does MBA with lid open. When c

  • My macbook air cracked, where is a good and cheap place to fix it in Melbourne?

    Can someone please tell me where is a good place to fix my cracked Macbook Air 13.3 inch. What is a reasonable price?

  • Format data using ADDRESS ENDADDRESS Command in SAPscript

    Hi All, I have an requirement to print the contact address in the follwing format. Actually I want to print first name and Last name immediately after TITLE (Mr.) like below. Mr. Jhon smith Street name, po Code.. But currently it is printing like thi

  • Conflict between Bonjour service and Airplay!!

    Airplay seems to dissappear, seemingly at random, on my Denon 2312ci AVR connected to my LAN through Netgear WNDR3800.  I also have an iPhone and an iPad. However, I have found a pattern and a possible sorce of the problem. If the AVR is initialized