Send a shell script via eppc

I want to tell a remote Mac to do a Terminal command through eppc:
<pre class=COMMAND>
tell application "Terminal" of machine ¬
"eppc://[email protected]" ¬
to do script "/usr/bin/enable DESKJET_640C"
</pre>
This of course always launches Terminal. How would I run the shell script through eppc without even launching Terminal?
For details, see this page

You can also run commands on the remote machine using ssh, which might be more secure:
ssh [email protected] "/usr/bin/enable DESKJET_640C"
(I didn't try it with the printer command, by the way, but I was able to do these without difficulty:
<pre class="command">ssh [email protected] "/usr/bin/lpstat -d -p"</pre>
and
<pre class="command">ssh [email protected] "cd ~/Documents; ls -l;"</pre>
charlie

Similar Messages

  • How to call a shell script via ODI

    Hi,
    I need suggestion on following issues:
    1) How to call a shell script via ODI?.. I tried using OSCommand utility .inspite of the execution being successful the data is not written into the new file in the desired format. After processing new file is created in the mentioned location but its empty.
    2) I'm calling a procedure in ODI to load data into my fact. But once the fact gets loaded i want to update the log details (num of rows processed,num of rows inserted,num of rows rejected etc) in my log table. I'm planning to use a proc for updating but need to know from where can i find these details. Is there a table in work rep which gives me these info like how we get if we execute an interface.?
    Please help me out.. Its urgent
    Regards
    Surabhi

    Hello,
    Question 1 appears a little vague, please elaborate. If you're looking to capture a return value from the command execution, you will need to pipe the return value to a file, then read from there.
    The execution information is stored in the SNP_STEP_LOG table in the Work Repository. You will need to do a series of joins to retrieve the exact table that was updated. Good luck with this...

  • How do I run a shell script via AppleScript?

    Seems obvious, "do shell script" but that doesn't work for me.
    I have an Automator app which runs a shell script, I'd like to take that into an AppleScript. My AS doesn't run the shell script. Perhaps "do shell script' is expecting the script to be located elsewhere? The rest of my AS runs fine, but the shell script doesn't.
    repeat with i from 1 to count of items in exportFolder
      do shell script
              "exiftool -overwrite_original -Photoshop:CopyrightFlag='True'"
      done
    end repeat
    As I say this works within an Automator app, what changes do I need to make it work in AppleScript?
    Thanks!

    Camelot wrote:
    repeat with i from 1 to count of items in exportFolder
    What is 'exportFolder'? Where is it defined?
    Thanks, 'exportFolder' is defined earlier in the script. The purpose of the script - which is run from within Aperture - is to rename the selected images, export them (to the 'exportFolder'), reset the version name and, using ExifTool, add metadata which Aperture does not write to exported JPEGs.
    I have a version of this which works in Automator but I couldn't see any clues there on setting the path to ExifTool.
    Here's the full (modified) script. Currently it returns an error
    Result:
    error "No file specified" number 1
    so I now need to understand if I can use 'exportFolder' (defined at the start) to tell Finder which folder to use.
    -- Creating filenames by making Version Name  from the IPTC Headline and Filename (with hypens where spaces exist). The Aperture Version Name is used to create the file's name on export. Once exported the Aperture Version Name is reset to its original.
    tell application "System Events"
              set exportFolder to (choose folder with prompt "Choose an export folder")
    end tell
    tell application "Aperture"
              set theSel to (get selection)
              if theSel is {} then
                        error "Please select an image or two!."
              else
                        repeat with theImg in theSel
      -- Creating a new Aperture Version Name which will become the exported file's filename.
                                  tell theImg
                                            set headline to (get value of IPTC tag "Headline" of theImg)
                                            set AppleScript's text item delimiters to " "
                                            set theTextItems to text items of headline
                                            set AppleScript's text item delimiters to "-"
                                            set headline to theTextItems as string
                                            set AppleScript's text item delimiters to {""}
                                            set objectName to (get value of IPTC tag "ObjectName" of theImg)
                                            set newVersion to (headline & "-" & objectName) as string
                                            set name of theImg to newVersion
                                  end tell
                        end repeat
      -- Exporting the files as JPEGs to chosen folder/Project Name using the Version Name as a filename
                        export theSel using export setting "JPEG - Original Size" to exportFolder
      -- Resetting the Aperture Version Name back to filename using IPTC Title (which should be the file's filename without suffex).
                        repeat with theImg in theSel
                                  tell theImg
                                            set title to (get value of IPTC tag "ObjectName" of theImg)
                                            set name of theImg to title
                                  end tell
                        end repeat
              end if
    end tell
    --Using ExifTool to set Photoshop Copyright Status etc
    tell application "Finder" to set theFiles to files of exportFolder as alias list
    repeat with eachFile in theFiles
              do shell script "/usr/bin/exiftool -overwrite_original -Photoshop:CopyrightFlag='True' -Photoshop:URL='http://davidgordon.co.uk/'" & quoted form of POSIX path of eachFile
    end repeat
    display dialog "Done that!" with icon note buttons "OK" default button 1 giving up after 10

  • [Solved] Control pulseaudio with shell script via pacmd

    Hi,
    i wrote a shell script that switches between the internal sound card and an usb card as soon as i dock my laptop. The script is triggered by an acpi-event that's generated when the laptop is docked.
    Everything works fine, if the script is run from the command line as the user that started pulseaudio. But if it's started by the acpi-event it can't connect to the pulseaudio server. it's run as:
    su --login my_user -c "/usr/local/sbin/toggle-sink.sh"
    where my_user is the user who started pulseaudio. i get the error:
    No PulseAudio daemon running, or not running as session daemon.
    How can i fix this? Somebody has an idea?
    ccc1
    Last edited by ccc1 (2013-01-05 11:06:03)

    PulseAudio uses some environment variables and X11 properties on the root window. You probably need a way to fake these.
    Have you tried something like
    export DISPLAY=":0"
    In the script, so it knows on which display these values are stored?
    You can also try running "pavucontrol" or "paman"(AUR) from the script, so it pops a window that is supposed to connect to PulseAudio. You might get a working pavucontrol window (which means pacmd and pactl should work), or a more detailled error message.
    If this still doesn't work, you may also try running it in system-wide mode, so everybody has access to it including your script.

  • Passing mulitple parameters to unix shell script via File adapter

    Hi,
    I have the following usecase.
    I have a set of files A, B, C, D  etc in a directory dir.  I also have a EOT ( end of transaction file).
    I need to merge this file once the EOT file is present in XI application server (  using NFS with File adpter).
    I have a script which can take the following paramters:
    1. EOT file name
    2. File names for A,B,C,D
    3. Directory names.
    Is it possible to send muliple parameters to the unix script from the File adapter?
    please share any blogs which do so.
    Thanks in advance,
    Best Regards
    Abhishek

    Hi,
    You can always call script from file adapter using "OS command" functionality, pass additional parameter like you do in unix for existing script (exact command which you type on unix prompt).
    Adapter will simply pass your OS command to operating system, so from XI point of view nothing is changed and it is your script which should take care of parameters.
    Regards,
    Gourav

  • Cold backup shell scripts

    Could anyone please send me Shell script for taking Cold backups on solaris
    The script will be run and will start taking backup
    if possible Automatically it will Down and UP the Database
    Thanks
    Mark

    I'm sure that a short google search should find some example for you.
    Here some scripts :
    http://orafaq.com/scripts/
    http://www.dbasupport.com/oracle/scripts/Backup_Recovery/
    But, that would be better to google for more results :
    http://www.google.fr/search?q=oracle+script+backup&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:fr:official
    Nicolas.

  • Call a shell script from ActiveSync form?

    Hi,
    I need to call a shell script from an ActiveSync form . How can I do this.
    I want to execute shell script at time of account create, update, delete.
    Thanks

    I would probably accomplish this by calling the shell script via java, and invoking the java code via xpress code in your ActiveSync form.

  • Launchd won't send email via shell script

    I'm trying to send an email via shell script. e.g. my shell script is something like this:
    #!/bin/sh
    echo testing | mail -s 'this is a test' [email protected]
    My launchdaemon runs the script: /usr/local/scripts/testscript.sh
    I know the script is working, because I added some debugging (I added a line: echo is this working and sure enough, "is this working" is showing up in the console) but the email part kicks off an error message about 30 seconds later: Stray process with PGID equal to this dead job: PID ### PPID 1 sendmail
    The script works when I run it with a cron job. But why wouldn't it work as a launchd item? And why is it I'm only having problems with the email segment of my scripts? I've tried other scripts and they all seem to work fine.

    There are no errors reported. I'm looking in /var/log/mail.log.

  • Shell script to send concurrent program output via FTP and Email

    Hi,
    Does any one have a shell script to send the output generated by a concurrent proram
    1 - Using FTP to an external server
    2 - By email as an attachment.
    Thanks

    There are more specific forums which address this question within the Oracle Technology Network. Please consider posting your question there for better responses. The focus of this forum is limited to HRMS suite of modules:
    http://forums.oracle.com/forums/categoryHome.jspa?categoryID=84
    Regards,
    Greg

  • Sending an email using shell script in Oracle Applications

    Hi,
    I have a pl/sql package which will call a shell script program.The shell script program is written in order to send the invoice hold details of AP as a mail.The parameters to this program are passed in the pl/sql package.
    The shell script program has
    5 parameters namely
    to - email
    from - email
    hold id - which is a number
    hold name - varchar2( free text)
    hold reason - varchar2( free text)
    the shell script looks as below.
    FROM_EMAIL=`echo $1|cut -f9 -d " "|sed 's/\"//g'`
    echo "From email id is $FROM_EMAIL" -- From email
    TO_EMAIL=`echo $1|cut -f10 -d " "|sed 's/\"//g'`
    echo "To Email id is $TO_EMAIL" -- to email
    PARAM0=`echo $1 | awk '{print $11}'|sed -e "s/\"//g"`
    echo "Param0: $PARAM0" -- hold id
    PARAM1=`echo "$1" | cut -d" " -f12-| sed -e "s/\" \"/\"^\"/g" | awk -F'^' '{print $1}'|sed -e "s/\"//g"`
    echo "Param1: $PARAM1" -- hold name
    PARAM2=`echo "$1" | cut -d" " -f13-| sed -e "s/\" \"/\"^\"/g" | awk -F'^' '{print $1}'|sed -e "s/\"//g"`
    echo "Param2: $PARAM2" -- hold reason
    the values that am passinf to this program are if suppose
    from email ---- [email protected]
    to email [email protected]
    12345 ------ hold id
    test hold name ------ hold name
    test hold reason ------- hold reason

    Is there a question here?
    In any case you could easily have done this inside the database using UTL_SMTP.

  • Sending email attachments using unix shell script

    hi
    I want to send report generated my spooled file as attachment using unix shell script.
    Can somebody help me out ?
    many thanks

    thanks a tonn it worked.
    but i have another issue is it possible to add names in CC also ?
    Also here is my code which spools the output of SP to a txt file. the File name is generated dynamically.
    as shown below:
    I need to send this generated file as attachement.
    how do I do this? Here the shell script
    =========================================================
    #!/bin/sh
    ORA_USER=scott
    ORA_PWD=tiger
    #Get the input parameter
    if [ ! "$1" ]; then
    STR="NULL"
    else
    STR="'"$1"'"
    fi
    #echo "exec pkg1($STR);"
    #Connecting to oracle
    sqlplus -s <<EOF
    $ORA_USER/$[email protected]
    ---sql plus enviornment settings
    set linesize 160
    set pagesize 60
    set serveroutput on size 1000000 for wra
    set feedback off
    set termout off
    column dcol new_value mydate noprint
    select to_char(sysdate,'YYYYMMDDHH24MISS') dcol from dual;
    spool &mydate.report.txt
    exec pkg1($STR);
    spool off
    EOF
    exit
    =========================================================
    the file name will take sysdate as name so that every time a new file will be generated.
    this file I need to send as attachment.
    null

  • How to send an mail to my email by using shell scripting

    Hi,
    I have shell script which generates some text file with text information. Now i want to send over the information available in the text file to my mail id.
    Can anyone give me over the syntax or the script.?
    Thanks a lot
    With Regards
    Vedavathi E

    same typo
    should read
    mailx -s 'subject for mail message ' your_email_address < text_file_to_be_sent
    Guido

  • Shell Script to send email with .txt file as attachment

    Dear Al,
    Could any one help me with code, for sending email with .txt file as attachment using shell script.
    Thank You!

    978334 wrote:
    Dear Al,
    Could any one help me with code, for sending email with .txt file as attachment using shell script.
    Thank You!http://bit.ly/XHfSCz
    https://forums.oracle.com/forums/search.jspa?threadID=&q=sendmail&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Do I run a shell script (bsh) via PL/SQL stored procedure?

    Hello guys,
    Do I run a shell script (bsh) via PL/SQL stored procedure?
    For example:
    procedure X is
    (variables)
    begin
    -- Read file data
    vFileHandle := utl_file.fopen('/mnt/novell/', 'file.txt','r');
    exception
    when 'INVALID READ FILE' then
    (I've to try running script to mount a Novell partition.);
    end;
    I've to installed Oracle 9.0.1 on Suse Linux.
    Please, any ideas or hints ...
    Thx and regards.

    You might be able to us the HOST command, I think you'd have to run it via dbms_sql, check this page for more details, not sure if it'll be of help but its worth a try..
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a82950/ch8.htm
    Cheers
    Rob

  • Sending Script via Email

    Hi Folks,
                 I am able to send Script via mail to yahoo id with PDF attachment but not able to recieve the pdf attachment in gmail i.e. I get the mail in gmail but not with PDF attachment.
    Well in scot the output type is PDF.
    Thanks for responses in Advance
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Feb 4, 2009 9:24 AM

    Hi,
    check below links,
    /people/erwan.lebrun/blog/2007/04/16/tips-tricks-email-fax-through-the-same-output-type
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/mail%2bsend%2bthrough%2boutput%2bcontrols
    Regards,
    Madhu

Maybe you are looking for

  • Mail App Not Working with Self-Signed Certificates

    First and foremost, I apologise for starting another thread that is 90% similar to others but I wanted to avoid falling into an existing context.  Like may others, I am having issues with the Mail App in Mavericks but I have an email account other th

  • KDE + undo in joe editor

    Hi. I have recently switched to kde-unstable repo and am having a problem. New konsole (so yakuake as well) uses 'ctrl-shift-minus' to shrink the font size. This is also the shortcut for the joe editor to 'undo' changes (in text console it's simply C

  • Cover flow on computer doesn't work.

    I am on a PC. When I attempt to use the Cover Flow display option my screen looks like this. I just updated to the latest iTunes version (10.3.1.55) and I still have the same problem. Is there a way to fix this?

  • Cancel payment - void cheque & reverse posting

    Hi All, I have a request to cancel payment using FCH8 for a range of cheques. (Mass cancellation  eg.10 cheques at one go) Is there another t-code that can function the same way as FCH8 but for mass cancellation? Help much appreciated. Thanks.

  • Issues with multiple Files with multiple subdbs on a single environment.

    I'm having an issue with Berkeley DB 4.2 on 32-bit platforms, regarding multiple physical files with multiple subdatabases in a single database environment. Specifically, when I open a subdatabase for a physical file, Berkeley DB thinks that it is us