Trouble with: "do shell script" password

Here's the code I'm trying to use to unlock my login.keychain via Applescript:
do shell script "security unlock-keychain login.keychain" password "mypasswordgoeshere"
I'm getting the following error message in AppleScript Editor:
error "password to unlock login.keychain:
security: SecKeychainUnlock login.keychain: The user name or passphrase you entered is not correct." number 51
Any suggestions on how to get this working?

That function uses the password differently. Run the following:
do shell script "security unlock-keychain -p password login.keychain"
(52720)

Similar Messages

  • Schedule workbook using with Unix shell script

    Hi,
    Can we schedule workbook using with Unix shell script?
    Thanks,
    Jay

    I can't imagine how.
    1. You can schedule Disco workbooks via Disco itself.
    2. You can schedule Disco workbooks to run and output in different file formats automatically via batch scheduler in Windows running Disco Desktop directly (or can user VBasic).
    3. You can schedule Disco workbooks to run and output in different file formats automatically via a Java program running the Java Command Line interface.
    Moving forward, Oracle has announced that with a further interfacing of Disco with XML Publisher, you'll be able to use Oracle Apps concurrent manager and scheduling. But that's coming supposedly at the end of this year.
    And I think that's about it.
    Russ

  • Trouble with Post Migration Scripts

    I try to run the volrepair script but am getting errors. I have run the Update NDS option from nssmu but still now luck.
    ccs_fs1:~ # /opt/novell/migration/sbin/serveridswap/scripts/repair/volrepair.rb -a admin.ccboe -p darabc -f /var/opt/novell/migration/
    Information: Checking NSS status ...
    Information: Getting GUID for NSS Pool ADMIN
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H "ldaps://192.168.0 .6" -x -D "admin.ccboe" "(&(CN=CCS_FS1_ADMIN_POOL)(objectClass=nssfsPool)) " "g uid" -W
    Error: Failed to get guid for pool ADMIN
    Information: Getting GUID for NSS Pool APPS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H "ldaps://192.168.0 .6" -x -D "admin.ccboe" "(&(CN=CCS_FS1_APPS_POOL)(objectClass=nssfsPoo l))" "gu id" -W
    Error: Failed to get guid for pool APPS
    Information: Getting GUID for NSS Pool SYS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H "ldaps://192.168.0 .6" -x -D "admin.ccboe" "(&(CN=CCS_FS1_SYS_POOL)(objectClass=nssfsPool ))" "gui d" -W
    Error: Failed to get guid for pool SYS
    Information: Getting GUID for Volume APPS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H "ldaps://192.168.0 .6" -x -D "admin.ccboe" "(&(CN=CCS_FS1_APPS)(objectClass=Volume))" "guid" -W
    Error: Failed to get guid for Volume APPS
    Information: Getting GUID for Volume SYS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H "ldaps://192.168.0 .6" -x -D "admin.ccboe" "(&(CN=CCS_FS1_SYS)(objectClass=Volume))" "guid" -W
    Error: Failed to get guid for Volume SYS
    Information: Updated NSS Pool objects successfully
    Information: MPVGUID v1.1 - Modify Pool or Volume GUID
    List is Empty, there are no Volumes
    GUIDModify failed, status -1
    Failed to Parse the XML from Buffer
    Information: Updated NSS volume objects successfully
    Information: MPVGUID v1.1 - Modify Pool or Volume GUID
    List is Empty, there are no Volumes
    GUIDModify failed, status -1
    Failed to Parse the XML from Buffer
    Warning: The following NSS Pools does not exist on the source server. Use "nssmu " option "Update NDS" for these Pools to repair.
    Warning: ADMIN
    Warning: APPS
    Warning: SYS
    Warning: The following NSS Volumes does not exist on the source server. Use "nss mu" option "Update NDS" for these Volumes to repair.
    Warning: APPS
    Warning: SYS

    $(UYou need to have the same set of pools and volumes on the source server and target server (atleast the names should be identical).
    The error says the pools or volumes that exists on the target server doesn't match with those on the source server.
    Try updating them from nssmu or iManager.
    Refer section "9.0 Preparing for Transfer ID -> 9.1. Prerequisites " of http://www.novell.com/documentation/....html#bookinfo
    -Ramesh
    >>>
    From:
    dmilam<[email protected]>
    To:
    novell.support.open-enterprise-server.migration
    Date:
    05/03/2010 11:06 PM
    Subject:
    Trouble with Post Migration Scripts
    I try to run the volrepair script but am getting errors. I have run the
    Update NDS option from nssmu but still now luck.
    ccs_fs1:~ #
    /opt/novell/migration/sbin/serveridswap/scripts/repair/volrepair.rb -a
    admin.ccboe -p darabc -f /var/opt/novell/migration/
    Information: Checking NSS status ...
    Information: Getting GUID for NSS Pool ADMIN
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H
    "ldaps://192.168.0 .6" -x -D "admin.ccboe"
    "(&(CN=CCS_FS1_ADMIN_POOL)(objectClass=nssfsPool)) " "g uid" -W
    Error: Failed to get guid for pool ADMIN
    Information: Getting GUID for NSS Pool APPS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H
    "ldaps://192.168.0 ..6" -x -D "admin.ccboe"
    "(&(CN=CCS_FS1_APPS_POOL)(objectClass=nssfsPoo l))" "gu id" -W
    Error: Failed to get guid for pool APPS
    Information: Getting GUID for NSS Pool SYS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H
    "ldaps://192.168.0 .6" -x -D "admin.ccboe"
    "(&(CN=CCS_FS1_SYS_POOL)(objectClass=nssfsPool ))" "gui d" -W
    Error: Failed to get guid for pool SYS
    Information: Getting GUID for Volume APPS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H
    "ldaps://192.168.0 .6" -x -D "admin.ccboe"
    "(&(CN=CCS_FS1_APPS)(objectClass=Volume))" "guid" -W
    Error: Failed to get guid for Volume APPS
    Information: Getting GUID for Volume SYS
    Information: Executing LC_ALL=en_US;ldapsearch -LLL -s sub -H
    "ldaps://192.168.0 .6" -x -D "admin.ccboe"
    "(&(CN=CCS_FS1_SYS)(objectClass=Volume))" "guid" -W
    Error: Failed to get guid for Volume SYS
    Information: Updated NSS Pool objects successfully
    Information: MPVGUID v1.1 - Modify Pool or Volume GUID
    List is Empty, there are no Volumes
    GUIDModify failed, status -1
    Failed to Parse the XML from Buffer
    Information: Updated NSS volume objects successfully
    Information: MPVGUID v1.1 - Modify Pool or Volume GUID
    List is Empty, there are no Volumes
    GUIDModify failed, status -1
    Failed to Parse the XML from Buffer
    Warning:The following NSS Pools does not exist on the source server.
    Use "nssmu " option "Update NDS" for these Pools to repair.
    Warning: ADMIN
    Warning: APPS
    Warning: SYS
    Warning: The following NSS Volumes does not exist on the source server.
    Use "nss mu" option "Update NDS" for these Volumes to repair.
    Warning: APPS
    Warning: SYS
    dmilam
    dmilam's Profile: http://forums.novell.com/member.php?userid=11991
    View this thread: http://forums.novell.com/showthread.php?t=409414

  • Trouble using Run Shell Script with python in Automator

    Hi. I have a python script I want to run in Automator (update_puzzles.py). All it does is check, rearrange and update files and there is not supposed to be any input. I can get the script to run outside of Automator, in Terminal, by navigating to the right directory and typing "python update_puzzles.py"
    I must not be setting up Run Shell Script correctly. I have it set to /bin/bash and Pass Input to stdin. The command line simply reads python /pathname/update_puzzles.py (where pathname is the path to the .py file, which I got by dragging the file onto the Run Shell Script command window). There are no actions before this in my workflow and the action after is View Results.
    The log says Run Shell Script failed, and the error is "Traceback (most recent call last):"
    Any suggestions?
    Thanks so much.

    If the script is expecting to do stuff with files in the same directory as the executable, you will probably need to add a statement to change to the appropriate working directory. The shell used in the Automator *Run Shell Script* action is a generic one that does not share any of the environment variables that the Terminal uses.

  • Trying to run program off network location using GPO with Power shell script.

    Hello All,
    Not much of a script writer. I am giving it a shot.  My issue is that I need to run a application update across our network and I am trying to do it with as little hands on as possible. So I was planning to push a GPO with a power shell script in it
    to run the program with elevated privileges. 
    Little background:
    We are running on a domain and end users do not have admin rights.
    The application is stored on a share on our network that is open to all domain users.
    The installer user name and password is a temp one and will only be valid for the 30 min window when everyone logs in at the beginning of the day.
    So this is what I have so far.
    $username = "USER"
    $password = "PASSWORD"
    $credentials = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
    Start-Process PSQLv11Patch_Client_x86.msp -Credential ($credentials) -WorkingDirectory \\Server\Folder\Folder1\Folder2\filder3\PSQLv11sp3_x32\
    But for some reason I keep getting :
    Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
    At line:10 char:1
    + Start-Process PSQLv11Patch_Client_x86.msp -Credential ($credentials) -WorkingDir ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
        + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
    Any help you could give would be great.
    Thanks,
    jdfmonkey

    Hi jdfmonkey,
    Has anyone provided an answer to your original question?  I am trying to use Start-Process to launch a process using another logged in user's credentials, and am not able to get it working:
    $cred=Get-Credential
    start-process Process.exe-WorkingDirectoryC:\Scripts-Credential$cred
    I get the same error that you mentioned:
    start-process : This command cannot be run due to the error: The system cannot find the file specified.
    At C:\Scripts\Process.ps1:2 char:1
    + start-process Process.exe -WorkingDirectory C:\Scripts -Credential ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
        + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
    When I leave off the credentials:
    start-processProcess.exe-WorkingDirectoryC:\Scripts
    It works correctly.  Does anyone have a solution to make this work correctly?
    Please ask your own question.  You issue is nothing like the current thread.  You clearly are using a user account that has no access to the folder.  It is a permissions issue.  It is not a scripting issue.
    If you need further help please start your own question.
    ¯\_(ツ)_/¯

  • Trying to close an app with a shell script which was launched by same app.

    This may be simple, but is confusing me. I have an app that executes a shell script at launch. The script is designed to check for the existence of files and if not found, I want to display a message and close the application. The problem seems to be that I can't close the app with the script, since the script was called by the app and the shell is tied up. Does that make sense? I can't close the app because the script/shell is still active. Any ideas?

    Just have the script output some value for the app to read and then quit. Once the app reads the value, it will wait for the script to quit (shouldn't take long, especially if the script isn't running anymore) and then, if the value is a flag to quit, quit.

  • Editing question, preferably with "do shell script"

    I would like to edit an expression
    from: blah blah /Paragraphs/one two three
    to: blah blah /Paragraphs/one-two-three
    where "/Paragraphs/" is always present
    but "one" might be anything
    Using sed with regexp seems like a way to go, but I don't know how to designate "one," which will vary. Viz.:
    set T to "blah blah /Paragraphs/one two three"
    set T1 to do shell script "echo " & quoted form of T & " | sed 's/\\/Paragraphs\\/{anything}/\\/Paragraphs\\/{anything}(change all subsequent spaces to "-")/g'"

    Hi,
    Can't believe I did it with sed! My test.txt file looks like this:
    blah blah #one here's some text
    blah blah #two more text
    blah blah #three and even more text
    #four number begins this line
    Here's the sed part:
    sed 's/#/\
    #/' < test.txt | sed '/#/ s/ /-/g' | sed '
    N
    s/\n#/#/
    Here I used "#" instead of "/Paragraphs/". Now, you translate this into a do shell script. If you need help with that, then write back. I now understand the N command for working with multiple line processing. Here's the tutorial I used:
    http://www.grymoire.com/Unix/Sed.html
    Edited: and here's the output
    blah blah #one-here's-some-text
    blah blah #two-more-text
    blah blah #three-and-even-more-text
    #four-number-begins-this-line
    gl,

  • Having problems with a shell script

    I'm trying to write a shell script that will echo back the command, and ask for confirmation before proceeding with the command.
    Here is what I have so far:
    Josh:~ josh$ cat ~/Desktop/safe
    #!/bin/sh
    echo "You have typed: "$1 $2 $3 $4"."
    read -p "Are you sure you want to continue? (y/n)" a
    if [ "$a" = "y" ]; then
    $1 $2 $3 $4
    elif [ "a" = "n" ]; then
    exit
    elif [ "a" != "y" ] [ "a" != "n" ];then
    echo "Type y or n."
    fi
    When I run it, and type n, (y works fine) I get a syntax error: ./safe: line 10: [: too many arguments
    Could you please help me fix it?
    Thanks!
    EDIT: If I change the last "elif" statement to a simple "else", it automatically does that statement anyway when the user types "n".
    Is there any better way to end the script when the user types "n"?
    Message was edited by: joshz
    Message was edited by: joshz
    Message was edited by: joshz
    Message was edited by: joshz

    joshz wrote:
    A few q's.
    1. you have "n=$#", but never use n. What is that for?
    Er... because I originally did it differently and then forgot to go back and delete this line!
    2. Why do you set list to a blank string? Just to initialize it?
    Yes. Habit. Sometimes it is an error to use an unassigned variable. It would not matter in this case because echo will not complain, but it still appeals to my sense of logic/tidiness. It also means that if I later change something in my script so that an unassigned variable will cause an error, I won't be stymied by a failure I can't explain. (Not really an issue in a script this short but might well be in a longer script.)
    3. "sed 's+, $+ and all enclosed files/folders+'" What does it do? What is s supposed to do? I know that s treats a string as a single line, but what's the purpose of that (and the +)? $+ would stand for the end of a line, but repeated one or more times. Why have the +'s?
    In this case, s is for substitute. The + is an arbitrary delimeter. A forward slash is standard, but if I use + I don't have to escape the slash in the phrase "and... files/folders". The whole thing says:
    Take the piped output from echo and find every occurrence of the pattern consisting of a comma followed by a space followed by an end of line (on every line of the piped input, but there's only one here). Substitute the first occurrence you find (on every line of the piped input, but there's only one here) with a space followed by "and... files/folders".
    Also, I ideally want the "and all enclosed files/folders" to appear only if there is a recursive option turned on, not all the time. (I guess it would be good enough to have it turn on if there's an r OR R option, because it would be too hard to program it in based on each command).
    To do that properly, you need to do things differently so that you can distinguish between arguments to the command and occurrences of strings in the names of files and folders. For example, you might have a folder named "My Folder-Revised". There are ways of doing this but they are not as simple as the sort of framework you're using here.
    If you are concerned about accidentally deleting files, have you considered using an alias called "rm" for "rm -i". That way, you do not have to remember to use "safe" either. Unfortunately, that won't work for "sudo rm". On the other hand, "sudo safe" won't necessarily work either. Where are you planning to install your script?
    - cfr

  • Trouble running automator shell script

    This is probably going to be an really simple fix, but I'm have trouble building an automator service that runs a bash shell script. All of the elements of the script work fine when plugged into shell, but for some reason the automator service is failing to run. The script calls ffmpeg to convert an audio file:
    for f in "$@"
    do
      fn="${f%%.*}"
      /Users/aa/Applications/ffmpeg/ffmpeg -i "$f" -acodec libmp3lame -q:a 7 -ar 8000 -ac 1 "$fn.mp3"
    done
    The script runs fine without the ffmpeg command, and the ffmpeg command runs fine in the terminal on its own. Where's the error coming from?
    Thanks!

    The first is what I'm getting from the bash terminal execution, the second from automator. I'm accenting the differences I see. Thanks for the help!
    ----bash----------------------------------------
    drwxr-xr-x@ 67 aa  staff  - 2278 Apr  6 07:42 .
      com.apple.progress.fractionCompleted  14
    0: group:everyone deny delete
    uid=501(aa) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81( _appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),398(c om.apple.access_screensharing),399(com.apple.access_ssh)
    0
    -bash
    TERM_PROGRAM=Apple_Terminal
    SHELL=/bin/bash
    TERM=xterm-256color
    TMPDIR=/var/folders/x9/y4r_w7gj4_j_3wkfxn6s6fqm0000gn/T/
    Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.oSzc5cau0v/Render
    TERM_PROGRAM_VERSION=343.6
    TERM_SESSION_ID=AF09D92C-2CB4-4069-A172-0DE12EB226BD
    USER=aa
    SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RFhFIs94Ad/Listeners
    __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
    PATH=/Applications/anaconda/bin:/Applications/anaconda/bin:/Applications/anacond a/bin:/Users/aa/anaconda/bin:/Applications/anaconda/bin:/Applications/anaconda/b in:/Applications/anaconda/bin:/Applications/anaconda/bin:/Library/Frameworks/Pyt hon.framework/Versions/3.4/bin:/Applications/anaconda/bin:/Users/aa/anaconda/bin :/Applications/Anaconda/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbi n:/opt/X11/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin:/usr/texbin
    PWD=/Users/aa
    LANG=en_US.UTF-8
    XPC_FLAGS=0x0
    XPC_SERVICE_NAME=0
    SHLVL=1
    HOME=/Users/aa
    LOGNAME=aa
    DISPLAY=/private/tmp/com.apple.launchd.YewceoE69R/org.macosforge.xquartz:0
    _=/usr/bin/printenv
    ----automator----------------------------------------
    /Users/aa
    drwxr-xr-x@ 66 aa  staff  - 2244 Apr  6 07:42 .
      com.apple.progress.fractionCompleted  14
    0: group:everyone deny delete
    uid=501(aa) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81( _appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),398(c om.apple.access_screensharing),399(com.apple.access_ssh)
    0
    SHELL=/bin/bash
    TMPDIR=/var/folders/x9/y4r_w7gj4_j_3wkfxn6s6fqm0000gn/T/
    Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.oSzc5cau0v/Render
    USER=aa
    SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.RFhFIs94Ad/Listeners
    __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
    PATH=/usr/bin:/bin:/usr/sbin:/sbin
    PWD=/Users/aa
    XPC_FLAGS=0x0
    XPC_SERVICE_NAME=0
    SHLVL=1
    HOME=/Users/aa
    LOGNAME=aa
    DISPLAY=/private/tmp/com.apple.launchd.YewceoE69R/org.macosforge.xquartz:0
    _=/usr/bin/printenv

  • Issue with calling Shell Script using DBMS_SCHEDULER

    Hi All,
    I am executing a shell script using DBMS_SCHEDULER from APEX web page. Execution part is working fine without any issues.
    In my shell script file (abc.sh) I have few oracle sql procedure calls which connects back to same database and that SQL call is not executing some reason, it not giving any errors.
    Inside my shell script code looks like this.
    sqlplus -silent $USER/$PASSCODE@$SCONNECT > /dev/null <<END
    set pagesize 0 feedback off verify off heading off serveroutput on
    echo off linesize 1000
    WHENEVER SQLERROR EXIT 9
    BEGIN     
    dbms_output.enable(1000000);
    do_enable_cons();
    dbms_output.disable;
    END;
    spool off;
    exit;
    END
    When I run this shell script file from backend it works fine now issues.
    Is there any restrictions in executing sql code using DBMS_SCHEDULER? Any ones help is much appreciated.
    -Regards

    james. wrote:
    Thanks you sb and Sybrand . It is problem with environment variables. After running .bash_profile in the beginning of the shell script, it is working fine.
    One issue is when I check the process it is showing two entries with two different process id's.
    The command I used
    ps -ef | grep <my script> is COPY & PASTE broken for you?
    any reason why you did not show us EXACTLY was produced by OS command above?
    >
    Is it something wrong with my code or is it normal? Is it really executing two times ?
    -Regards
    bcm@bcm-laptop:~$ sqlplus user1/user1
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 20 15:14:15 2012
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    15:14:15 SQL> !ps -ef | grep sqlplus
    bcm      24577  1903  1 15:14 pts/0    00:00:00 sqlplus           
    bcm      24579 24577  0 15:14 pts/0    00:00:00 /bin/bash -c ps -ef | grep sqlplus
    bcm      24581 24579  0 15:14 pts/0    00:00:00 grep sqlplus
    15:14:23 SQL> how many different copies of "sqlplus" running on my laptop based upon actual output above?

  • Refreshing a status bar with a shell script

    Hello,
    I use the lemonbar to display some informations about my system. The lemonbar
    use a shell script to display informations. Sometimes I want to refresh my status bar.
    To be brief: is it possible to refresh the status bar without checking for example every 2 seconds with
    a "sleep 2" command ?
    Let's take an example: with my window manager I switch
    from desktop 1 to desktop 2. At the moment I use a sleep command and I refresh the information
    every 2 seconds. Is there a way my shell script get notified about the switch from desktop 1 to desktop 2 and can refresh
    the information in my status bar ? So it would be not necessary to execute a sleep command every two seconds.
    Until now I found nothing. An idea is to react to a keyboard shortcut (the switch from desktop 1 to desktop 2), but
    I don't know if it's possible.  Perhaps something with a signal ? I also know some X events are generated by creating or closing windows
    for example. I don't know if reacting to X events would be another possibility.
    Thank you!

    kokoko3k wrote:Eg: if a WM writes the current desktop in a file, then you can just watch that file via inotify and do an event driven action.
    I will keep it in mind. I have to check, but it's possible I can use that solution.
    kokoko3k wrote:As a side note: how do you switch "desktops" without a WM? Was it just an example?
    Yes, it was an example. If I change in the future I could use the solution for the chosen wm.
    But at the moment I can create groups. Each groups get a number and I can raise or hide all applications
    in that group. So it's the same problem.

  • Assistance with Automator Shell Scripting

    Is there a way to take the Ask for text, set the returned value as a variable and use that variable later on in a Shell Script action?
    Thanks in Advance

    This is showing how you would access your variables. $@ will contain all the command line variables and the for do loop intinerates over each one one at a time.
    So you would replace this with your script of course but thats how you would access the arguments.

  • Problem with executing shell script on linux through java code.

    i am facing problem to kill jboss process on linux that is my application requirement. for that i created one shell script that will get all the process for jboss instance and kill them when i am running that script from command prompt on linux its working perfectly.
    The command i am using ---
    /opt/RW9/jboss/v4.0.5.GA/bin/restartjboss.sh.
    but when i am running through java code its not working.
    the java code i am using is:-
    pp = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "/opt/RW9/jboss/v4.0.5.GA/bin/restartjboss.sh"});
    could anyone tell me what is the problem ?
    Edited by: akm198110 on Sep 2, 2008 9:24 AM

    I got the problem after long struggle ,after doing proper path i am able to execute the shell script..

  • Problems with executing shell script within oracle procedure

    I have procedure that's owned by Semantic user. This procedure calls job scheduler (owned by USER1) which in turn executes a shell script load_semantic.sh (owned by USER1).
    Now, there is a shell script(checkCount.sh)inside of this one (owned by this USER1) that has following contents:
    checkCount.sh
    #!/bin/bash
    MODEL=$1
    sqlplus -S user/pass << EOF
    whenever sqlerror exit 1;
    set echo on
    set verify off
    MERGE INTO SEMANTIC.COUNT_STATISTICS s
    USING (SELECT '$MODEL' AS MODEL, 0 AS NEW_COUNT, SYSDATE AS NEW_DATE, 0 AS OLD_COUNT, SYSDATE AS OLD_DATE FROM dual) t
    on (s.MODEL = t.MODEL)
    when not matched then
    INSERT (s.MODEL, s.NEW_COUNT, s.NEW_DATE, s.OLD_COUNT, s.OLD_DATE)
    VALUES (t.MODEL, t.NEW_COUNT, t.NEW_DATE, t.OLD_COUNT, t.OLD_DATE);
    COMMIT;
    UPDATE SEMANTIC.COUNT_STATISTICS SET  MODEL = '$MODEL', NEW_COUNT = (SELECT COUNT(*) FROM TABLE(SEM_MATCH('{?s ?p ?o}',SEM_Models('$MODEL'),NULL,SEM_ALIASES(SEM_ALIAS('','http://VISION/DataSource/SEMANTIC#')),NULL)) ),NEW_DATE  = SYSDATE,
    OLD_COUNT = NEW_COUNT, OLD_DATE  = NEW_DATE WHERE MODEL = '$MODEL' AND NEW_DATE = (select max(NEW_DATE) from SEMANTIC.COUNT_STATISTICS where MODEL = '$MODEL');
    COMMIT;
    exit;
    EOF
    So when I execute SEMANTIC.PROCEDURE:
    SEMANTIC.PROCEDURE => USER1.JOBSCHEDULER =>USER1.load_semantic.sh =>USER1.checkCount.sh
    It never populates the table SEMANTIC.COUNT_STATISTICS.
    I tried giving all of the permissions but I am probably missing something...
    Maybe fresh eyes can see something that I can't.

    I can't believe I am going to say this but the reason it was not working was because I removed oracle environment path from my script by mistake.
    . /etc/profile.d/oracle.sh
    Ugh...
    Now it is working perfectly.
    Btw, sqlplus does know about shell environment variables.
    THANK YOU GUYS!!! YOU ARE THE BEST!!!!!!!!!!!!!!!!!!
    I ONLY HAVE YOU TO TALK TO WHEN I AM STUCK ON A PROBLEM.

  • Help with broken shell script

    Hi,
    We had the shell script below created for our school last year to keep the students from jumping off of our wireless network so they had to go through our content filters. We put the script on all of the student laptops (MacBooks and MacBook pros) so it ran as a process in the background. It worked beautifully for the  whole year.
    Now we are in the process of upgrading our laptops from Snow Leopard to Lion and we've discovered that the script no longer works in Lion. I am guessing it is something simple but I don't see it. Does anyone know what about the OS changed that would cause this script to stop working?
    Thanks
    Tim
    #!/bin/sh
    currentSSID=`networksetup -getairportnetwork Airport | awk {'print $4'}`
    if [ "$currentSSID" = "optimumwifi" ] ; then
            echo "Disassociating.."
            /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/ai rport --disassociate
            networksetup -setairportnetwork Airport "Student" "only4study!"
    fi
    if [ "$currentSSID" = "timewarnercablewifi" ] ; then
            echo "Disassociating.."
            /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/ai rport --disassociate
            networksetup -setairportnetwork Airport "Student" "only4study!"
    fi
    if [ "$currentSSID" = "xfinitywifi" ] ; then
            echo "Disassociating.."
            /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/ai rport --disassociate
            networksetup -setairportnetwork Airport "Student" "only4study!"
    fi

    Brilliant, that worked perfectly! Thanks for the your help Linc.
    Coincidentally, I found a posting on the website stackexchange.com that helped explain why it stopped working in the first placed and why "Airport" alone used to work in Snow Leopard.
    Note what it says at the bottom:
    "the port name is Wi-Fi on 10.7 and AirPort on 10.6. The device name can be at least en0,en1, or en2 depending on your setup."
    http://apple.stackexchange.com/questions/36891/bash-script-to-toggle-wifi-in-lio n

Maybe you are looking for

  • Newer software on an old iMac?

    As I have talked about in another post, I was given an iMac with OS9. We were recently given a Mac software, Zoo Tycoon, to play on this computer. It says it needs OS 10 to work, but we tried anyway. Surprise it didn't work. Is there anyway to update

  • Help me get my music from i pod to computer windows 8

    How do I get music from my I pod to my new computer is this possible it says something about a driver

  • Batch determination reg.

    Hi dudes, 1.if we want batch determination for components for prod/process order, whether we need inventory management settings for batch determination or for production/process order. 2. if we maintain settings for production/process order, then we

  • Keyboard macro app

    I need an app that will do autotext for me. Like for example lets say I want a signature for posting on this board. I could create one, and then type in the word signature and the text would show. MS Word has such abilities but I need something for t

  • Sony a77.

    Elements 9 will not open/read raw files from my new sony a77 SLT camera.  What can I do?