Automator not executing shell (bash) scripts, behaving strangely

Hi everyone!
I was using some Automator "programs" successfully with OS X 10.8 which did nothing more than executing shell scripts. However, after upgrading to Mavericks those workflows ceased to work. I have tried several approaches, e.g. using the shell script action or using Apple Script as a wrapper for executing a shell script. Unfortunately, I can't get it to work.
Automator is behaving quite strangely, tough. Every approach that I tried works well as long as I'm hitting the "play" button in Automator itself. When I save the workflow as a program, either I can't execute it or or I will get strange errors (something like "Can't execute, error -1712" or so).
I can't wrap my head around the fact that everything works fine if I execute the workflow but saved as a program it won't work. Any help would be highly appreciated.
Regards
  Steffen

Okay, I think I found it. There were two "hanging" automator processes, an "automator runner" and another one which name I can't remember (started with "automator" tough).
I killed both. After that the workflows worked again.
I still use the "execute bash in an Apple Script" solution. As this worked, I didn't try anything else (e.g. using the shell script action itself).

Similar Messages

  • Upgraded ROX filer not executing shell scripts

    Hi all,
    I run ICEWM+ROX filer as my lite desktop but after a recent upgrade, ROX does not execute shell scripts on mouse click. It appears that filetype detection has changed so that all scripts are shown with the shellscript icon, whereas before those without a .sh extension where shown with the kde type "cogwheel".
    Any tips much appreciated.
    My thanks in advance!

    I've found a lot of things I don't like about the latest ROX upgrade... too much caching nowadays in my  opinion.

  • How can I execute a bash script by double clicking in finder

    Hello!
    How can I execute a bash script using finder? Or better: How can I create an alias, which executes my bash script?
    Thanks Johann

    Add the suffix command in your script name. E.g. Script.command.

  • Find gives permission denied on files when executed from bash script.

    I've written a really basic script just to check what new music was added to my library over the past n days:
    #!/bin/bash
    echo "Check for days?"
    read days
    `find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print`
    If I run the find from the shell it runs fine but the script always gives this error:
    ./listNewMusic.sh: line 7: /home/MrGone/Music/Smod/SModcast-19.mp3: Permission denied
    Anyone know why?
    Thanks.

    It is because you're running the find command in a sub-shell.  What is returned by the sub-shell is being run by your script.
    Change:
    `find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print`
    to
    find /home/tom/Music/ -iname "*.*" -type f -mtime -$days -print
    Last edited by steve___ (2010-07-10 12:50:38)

  • PowerShell CSV script behaving strangely with different keyboard language layout

    Hello all,
    OK kinda stumped on this one. I have written the below simple script that takes a group and outputs its members to a CSV file. However, the script is not outputting correctly when it is run under a different keyboard layout, in this case a Norwegian
    keyboard layout ("For" loop doesn't serve any purpose in this trimmed script version but was left in as this was the script that was tested):
    cls
    import-module ActiveDirectory
    $group = "Group1"
    #grabbing all of the groups properties so they can be referenced easily when needed (reduces multiple calls to AD)
    [array]$members = get-adgroupmember $group
    $Report = For($i=0;$i -lt $members.count;$i++){
    #When processing the first member in the group, output this way
    If($i -eq 0){$Table = @{`
    "UserID"=$members[$i].SamAccountName;`
    "Type"=$members[$i].objectclass
    #When processing all other members of the group, output this way
    Else{$Table = @{`
    "UserID"=$members[$i].SamAccountName;`
    "Type"=$members[$i].objectclass
    #Create the table using the above output
    New-Object psobject -Property $Table | select 'UserID','Type'
    } #end of $Report and "for" loop above
    #Export the table to CSV on the user's desktop
    $Report | export-csv C:\Users\$env:Username\Desktop\$group.csv -NoTypeInformation
    #Open the CSV file we just created
    invoke-item C:\Users\$env:Username\Desktop\$group.csv
    The script outputs to CSV fine for my "English" keyboard layout:
    However, when the script is run on a computer with a Norwegian keyboard layout, the output is not delimited correctly:
    Has anyone ever dealt with anything like this, or know why the output is not delimiting correctly? There are no errors when running the script in either English or Norwegian keyboard layout.

    Ahhh... I bet you guys are exactly right!
    I did a quick Google search and found this TechNet thread where jrv discusses an issue similar to mine:
    http://social.technet.microsoft.com/forums/scriptcenter/en-US/4de7ed7a-f1b3-4e35-98b1-ef1f7f2ee7b2/powershell-export-from-excel-to-csv-having-delimiter
    One of the links jrv gives in the article describes how to find what delimeter you're using:
    http://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/
    So it looks like I can just run a "(get-culture)" command in my script before I output to CSV and then use the "delimeter" parameter of export-csv. With the get-culture cmdlet, there's 2 parameters I believe I can use: the "LCID" parameter, and the "keyboardlayoutID"
    parameter (but I can't seem to find a difference between the two parameters). Would you guys know which one of these parameters (LCID or keyboardlayoutID) might determine the delimiter used in CSV's? (link to LCID's below)
    http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx

  • Bash script run via cron not executing MYSQL command

    I have a bash script which is run from a cron,
    It is executing as I have it write to a log file which it does correctly.
    I am wanting the bash script to restore a mysqldump file.
    When I run the bash script manually the dump file gets loaded fine. But when I run it through the cron the mysql command appears to be ignored.
    The mysqldump file is 54MB and I have checked to make sure that MYSQL is included in the global users path in /etc/profile
    Does anyone know why this maybe??
    Here is the bash file
    #!/bin/bash
    date >> /home/user/crons/crons.log
    echo "Started loadbackup" >> /home/user/crons/crons.log
    cd /home/user
    dbuser=root
    dbpass=password
    dbname=databasename
    filename=backup
    mysql -hlocalhost -u"$dbuser" -p"$dbpass" "$dbname" < " >> /home/user/crons/crons.log
    My crontab looks like
    02 17 * * * /home/user/crons/loadbackup.sh
    Many thanks
    Richard

    Hi Richard,
    Have you tried redirecting the script output in the cron to see if an error is being reported?
    I.e.
    02 17 * * * /home/user/crons/loadbackup.sh > /tmp/loadbackup.log 2>&1

  • How will execute shell scripts from AR91

    hallo, please help me to find where I can configure the execution mode for scripts called als run-Script in acroread.
    Following scenario: a pdf file (see attachement testpdf.pdf), generate from pdflatex (see testpdf.tex.txt) calls a bash script beispiel.sh (see attachement beispiel.sh.txt). Dependend from situation opens an editor window or an xterm. Under GNOME can we not open the xterm, there start only editor windows - gvim/emacs/kwrite, but not well defined. With acroread7 opens a xterm after menu dialogs. How can i configure an defined behaviour ?
    Thanx for any help
    Regards, Matthias

    Hi Matthias,
    To achieve this you can try to change the default "Open With" settings of .sh files to "xterm" as highlighted in the snapshot below
    This will enable to execute any shell script in xterm.
    Let us know if this helps.
    Thanks,
    Vaibhav

  • 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

  • ICal failing to run applescripts: The 'Open' button does not change to 'Run', and the script file is opened but not executed on alert.

    iCal failing to run applescripts: The 'Open' button does not change to 'Run', and the script file is opened but not executed.

    Calendar (not called iCal anymore) does not include that capability any longer, apparently.  What you have to do now is go to Automator and create a Calendar Alert action.  You can add a Run AppleScript object to the action and paste in your script there, then when you save it, it will become available as a choice in the alert menu in Calendar.

  • Bash: script not working even after using shopt

    below is script i am trying. I am trying to get the latest modified file in a folder:
    #!/bin/bash
    shopt -s extglob
    name=$(echo *(om[1]))
    echo $name
    i am expecting filename instead *(om[1]) is echoed. As such the script does not give any error due to using shopt.
    i try the command on commandline it gives the filename as output.
    % cd other
    % echo *(om[1])
    mumbai123.txt
    why echo *(om[1]) is working on commandline but not in bash script.
    Last edited by sant527 (2014-10-02 03:53:53)

    sant527 wrote:why echo *(om[1]) is working on commandline but not in bash script.
    Are you using zsh as your shell?

  • Linux Script doees not executed as cronjob

    I have created a script b.sh as follows to get the status of Oracle Database
    [oracle@accurman1 tmp]$ cat b.sh
    #! /bin/bash
    $ORACLE_HOME/bin/sqlplus -s < /tmp/1.sql >> /tmp/mylog.log
    [oracle@accurman1 tmp]$
    [oracle@accurman1 tmp]$ cat /tmp/1.sql
    connect sys/xxx@orcl as sysdba
    set heading off
    set feedback off
    set verify off
    select 'STATUS:'||status from v$instance;
    select 'MODE:'||log_mode from v$database;
    [oracle@accurman1 tmp]$
    when execute manually from command promp it executes properly and I get the sql output in mylog.log file
    However if I schedule the script, b.sh , as cron job then it does not executes... and do not through any error.....
    What is wrong here?
    Message was edited by:
    johnveslin

    #! /bin/bash
    $ORACLE_HOME/bin/sqlplus -s < /tmp/1.sql >> /tmp/mylog.log
    What is wrong here?Environment. Cron doesn't know the enviroment of (oracle) user.
    So set the environment (at least ORACLE_HOME) in your b.sh script.
    as cron job then it does not executes... and do not through any error.....Usually when error occurs during cron execution it is mailed to user's inbox.
    So try to log as that user (su - oracle) and try to execute "mail" command.
    The other way how you can log the output and errors is (crontab entry example):
    5 * * * * /home/oracle/bin/my_cron_script >> /tmp/my_cron_script.log 2>&1

  • Execute Shell Script through Demantra Workflow

    Hi All ,
    Can we execute shell script from Demantra Workflow ?
    If yes where should we place the shell script file and wat should be the commandline command in the step .
    We have the Demantra installed on a windows server and the workflow manager is on a linux server .
    the batch file on the windows server can be executed through the secure shell from the linux server .
    I am trying to achieve the same through thr demantra workflow
    Appreciate any input on the same .
    Thanks and regards
    Suzy

    Hi,
    Shell script is not supported till Demantra 7.2.0.2 WF.
    I have checked with Oracle team also and reply I got below for your reference:
    QUESTION
    *=========*
    As per your details, shall we conclude like this:
    *"only *.bat and *.exe files can be used in workflow. Demantra standard functionality doe*
    *s not support shell script in workflow"*
    ANSWER
    *=======*
    Hi ,
    The Demantra standard functionality 7.2.0.2 does support shell script in workflow.
    Thanks,
    Asya
    Please review the note#468071.1-Unable to Run EBS Workflows that Call EngineManager.exe in
    You will find this note is referring to the Enhancement Request Bug 6644455-- ANALYTICAL ENGINE
    NOT AVAILABLE ON UNIX/LINUX
    But the enhancement bug exist and I hope it is fixed in Demantra 7.3.
    Tks
    MJ

  • Bash script running on my MBP 10.7.4 but not on other Macs (all 10.7.4)

    A friend of mine wrote me this short script to run in terminal that downloads a particular file every n seconds from a password protectected FTP site. The script worked on his linux machine and on my Mac but not on my collegues Macs. I'm wondering if anybody knows reasons why it may be failing on other Macs.
    We changing the first line from: #!/bin/sh to #!/bin/bash
    and exceuting with
    user_prompt_$ bash ./download_stats.sh
    Another idea is to script cyberduck but it doesn't support applescript though may have a comand line interface (looking into that at present).
    There error output from one of the accounts it fails on follows the script listing.
    #!/bin/sh
    # =================================================================
    # Download XML_stats Bash Script
    # Filename:     download_stats.sh
    # Arguments:    input_filename  - file to be downloaded from remote server. Optional.
    #               poll_interval   - seconds delay between downloads. Optional (input_filename must be present)
    # Use:          Invoke from shell, e.g. ./download_stats.sh
    # Author:       Luke Neeson
    # Date Created: 2012-05-31
    # Comments:     This script will download a given file, input_filename, at the given interval, poll_interval.
    # Notes:
    # - .netrc is required in the current directory and must contain the logon details for the fox server. This could be installed in the user home directory, if so, delete the line marked below.
    # =================================================================
    # If the .netrc is in the directory of this script, the following must be enabled. If the user's home .netrc is to be used, comment out the following line:
    export HOME="`pwd`"
    export input_filename="the_file_I_want_as_default.xml"
    export poll_interval=10
    if [ ! -z "$1" ] ; then
      export input_filename="$1"
      if [ ! -z "$2" ] ; then
        export poll_interval="$2"
      fi
    fi
    while [ true ]
    do
      ftp access.foxsports.com.au << EOF 2>&1 | sed 's/.*AUTH GSSAPI.*//g' | sed 's/.*KERBEROS.*//g'
      get  "$input_filename"
      quit
    EOF
      sleep $poll_interval
    done
    ERRORS RETURNED:
    a-mbp:~ macca$
    a-mbp:~ macca$ cd ~/stats/download_rugby_stats/
    a-mbp:download_stats a$ sh download_rugby_stats.sh
    : command not founds.sh: line 16:
    : command not founds.sh: line 19:
    : command not founds.sh: line 22:
    download_stats.sh: line 39: syntax error: unexpected end of file
    a-mbp:download_stats a$
    Those are the blank lines and 39 is the last line of script.

    Thanks Bob, Luke mentioned which but didn't go into it.
    cat -vte download_rugby_stats.sh   ——>    Does this look good to you?
    # ================================================================= $
    # Download Rugby Stats Bash Script$
    #$
    # Filename:     download_rugby_stats.sh$
    # Arguments:    input_filename  - file to be downloaded from remote server. Optional.$
    #               poll_interval   - seconds delay between downloads. Optional (input_filename must be present)$
    # Use:          Invoke from shell, e.g. ./download_rugby_stats.sh$
    # Author:       Luke Neeson$
    # Date Created: 2012-05-31$
    # Comments:     This script will download a given file, input_filename, at the given interval, poll_interval. $
    # Notes: $
    # - .netrc is required in the current directory and must contain the logon details for the fox server. This could be installed in the user home directory, if so, delete the line marked below.$
    # ================================================================= $
    $
    # If the .netrc is in the directory of this script, the following must be enabled. If the user's home .netrc is to be used, comment out the following line:$
    export HOME="`pwd`"$
    $
    export input_filename="Rugby_IRB20120101_Client.xml"$
    export poll_interval=10$
    $
    if [ ! -z "$1" ] ; then$
      export input_filename="$1"$
      if [ ! -z "$2" ] ; then$
        export poll_interval="$2"$
      fi$
    fi$
    $
    while [ true ]$
    do $
      ftp access.foxsports.com.au << EOF 2>&1 | sed 's/.*AUTH GSSAPI.*//g' | sed 's/.*KERBEROS.*//g'$
      get  "$input_filename"$
      quit$
    EOF$
      sleep $poll_interval$
    done$
    $

  • How to set the time limit to execute shell script

    I am using Runtime exec() method to execute a shell script
    if the script hangs for long time infinitely then how to get the control
    return to the program.
    Thanks in advance

    rmi_rajkumar wrote:
    let me explain with an example
    script name is test.sh
    Runtime.exec("test.sh") this will start a new process
    if (proc.waitFor() == 0) {
    try {
    InputStreamReader isr = new InputStreamReader(proc.getInputStream());
    BufferedReader br = new BufferedReader(isr);
    String line;
    while ((line = br.readLine()) != null) {
    outputBuf.append(line).append(ConfigOptions.getLineModeStr());
    } catch (IOException ioe) {
    if test.sh did not exit and hangs with no response
    in this case proc.waitFor() will not execute try catch the control will remain if statement
    my question is insteadof waiting indefinitely need to set a time out say 1 hour and kill the process that executed the scriptYou really need to read the article in the link given by another poster. Your code will not work correctly because you are waiting for the process to end before reading the stream and the processes may never end because you are not reading the stream until after it ends (you need to use muli-threading as explained in the article). If the process really did hange you could probably use destroy(); but, for now, the real problem is your code.

  • How to prevent Automator's "run shell script" to create fully decomposed forms of my strings ?

    I am using Automator's "run shell script" and I am seeing that it outputs fully decomposed forms of my strings.
    For example, when I set the action to "echo été" in a service (with "Replace selected text" activated) and run that into a Textwrangler window, I'll get fully decomposed forms that Textwrangler won't understand. But when I simply type that command into Terminal, I get my string in composed form.
    The problem is not the display issue, but the fact that if I want to run grep for example in "run shell script", I will not be able to find the proper strings since the forms are different.

    Originally I was using $@ to parse a string and get the result pasted by the service. That was a while ago. There, I noticed that some Japanese characters were messed up. Basically all the kana characters that come with voicing markers like が-ga (instead of か-ka) etc. I did not have the time to pursue that issue though.
    Then, last night, I found that a colleague of mine had tried to use $@ to feed to a local dictionary application called ding (http://ftp.tu-chemnitz.de/pub/Local/urz/ding/). His problem was with characters that had umlauts. After verifying how he wrote his action I remembered that I had similar issues with Japanese.
    Basically his command was "/path/to/ding $@"
    That's supposed to use the selected string as an argument to pass to ding, which will launch a Wish application where the string is used as the searched item.
    From Terminal, that works a treat. But the exact same line in Automator (with input as argument, not as stdin) messed the composition and the resulting string was not recognized by ding as a match to what it was supposed to match.
    So, I tried a few things to get to the core of the issue and found that a simple "echo [accented characters]" was enough to reproduce the difference in string handling between Automator and Terminal. That difference is also reproduced on a number of person's machines.
    I have a number of services that basically revolve on "run shell script" actions and involve 3rd party application outputs, preference files etc. so it would not be convenient to show that to you.
    I have sent a mail about this issue to the automator list yesterday too:
    http://lists.apple.com/archives/Automator-users/2011/Jun/msg00004.html

Maybe you are looking for