Dealing with spaces in shell scripts

I have read everything I can about quotes (single and double), backslash and more and I'm stuck.
I need to compare files to do some make like things. Many of the files have spaces in the name. Here's the script:
#!/bin/sh
ROOT=$HOME
PROJECT="/Documents/MMM/Victoria/Documentation"
FILE="/Audio Control 1.0 a1.pages"
FULLPATH="${ROOT}${PROJECT}${FILE}"
echo ls -l \"$FULLPATH\"
ls -l \"$FULLPATH\"
and here's the output:
ls -l "/Users/wesM/Documents/MMM/Victoria/Documentation/Audio Control 1.0 a1.pages"
ls: "/Users/wesM/Documents/MMM/Victoria/Documentation/Audio: No such file or directory
ls: 1.0: No such file or directory
ls: Control: No such file or directory
ls: a1.pages": No such file or directory
what's echoed looks exactly right, and if I copy and paste to a shell, it works fine, but when run from within the script, its acting like the double quotes are not there?

If what I'm seeing in the post
ls -l "$FULLPATH"
is correct, then you have told the shell "These are not the quotes you are looking for". So the shell did NOT treat the double quotes as having an special meaning, removed the backslashes, parsed the string into 4 arguments, and passed the 4 arguments including the leading and trailing quotes to the ls command:
arg[1]: "/Users/wesM/Documents/MMM/Victoria/Documentation/Audio
arg[2]: Control
arg[3]: 1.0
arg[4]: a1.pages"
Notice that the leading double quote is part of arg[1], and the trailing double quota is part of arg[4].
You most likely wanted to say something like:
echo ls -l ""$FULLPATH""
ls -l "$FULLPATH"
Notice that I added an extra layer of double quotes to the echo command. The first layer of double quotes tells the shell that this is a single argument. The backslash double quotes tells the shell that these quotes inside of a double quoted string are NOT terminating the string, but rather are to be treated as part of the string.
And no backslashes on the ls command tells the shell that whatever $FULLPATH expands to is to be treated as a single argument.
Always remember it is the shell that parses the command line into tokens so it is also the shell that handles the quoting. The command is just handed an array of strings already broken into individual arguments. The command does not see the quotes. The command does not see the variables.

Similar Messages

  • Spaces in shell script application?

    how do I signify a space in the application name in the following script:
    do shell script "/Applications/Plex Media Server.app/Contents/MacOS/Plex Media Scanner -s -r"

    You can escape spaces in the path with a backslash, but since the backslash is also the escape character you need to escape it as well, so you wind up with:
    /Applications/Plex\\ Media\\ Server.app/Contents/MacOS/Plex\\ Media\\ Scanner
    Usually it is easier to use quoted form of, and let the system figure it out:
    set somepath to quoted form of "/Applications/Plex Media Server.app/Contents/MacOS/Plex Media Scanner"
    do shell script somepath & " -s -r"

  • Executing if condition in a sql prompt with in a shell script

    Hi all,
    i need to write a shell script where i need to execute a sql statement. if the count from the above sql is greater than certain value i need to execute a another sql statement.After some time i need to check the count again using above sql and if the count is less than certain value i need to execute a different sql statement. One more time i need to check the count and then i need to get an email.
    Could anyone help me in completing this script
    Thanks,

    Could anyone help me in completing this scriptNot really because "shell script" is OS & Shell dependent & you decided to NOT share these details with us.
    Just write a PL/SQL procedure & then you have an OS independent solution!

  • Error in calling SQL plus program with parameter from Shell script

    This is my Shell script. I am trying to call in the SQL plus program with the parameter and the shell script is registered as a concurrent program.
    PARAMETERS=`echo $1 |tr -d '\"'`
    DB_USER_ID=`echo $PARAMETERS|cut -d" " -f3|cut -d"=" -f2`
    CONN_STRING=$DB_USER_ID
    REQ_DATE=`echo $PARAMETERS|cut -d" " -f9|cut -d"=" -f2`
    timestamp=`date +%m-%d-%y-%H:%M:%S-%Z`
    timestam=`date +%y-%m-%d`
    sqlplus -s $CONN_STRING @ar_statement.sql $REQ_DATE
    chmod 755 statement.sh
    . statement.sh
    My Sql plus program is like this.
    set pagesize 0
    set heading off
    set feedback off
    spool $GEC_TOP/log/ge_ar_statement.sh
    select output_file_name
    from fnd_concurrent_requests
    where trunc(actual_completion_date) = '&2';
    spool off;
    exit;
    When i run the concurrent program, i am getting the following error:
    ar_statement: line 14: REQ_DATE: command not found
    Enter value for 2:
    User requested Interrupt or EOF detected.
    ar_statement.sh: line 1: Enter: command not found
    ar_statement.sh: line 2: User: command not found
    ar_statement
    Program exited with status 127
    I am not strong at Unix Porgamming and i would request someone who can
    help me out as soon as possible.
    I need this solution quickly and thank everyone in advance.
    Thanks.

    Can you put your coding between code statements, like shown in the FAQ. It will be easier to read.
    Looking at your script, my first guess is that crontab will not find your sqlplus since your script does not have $HOME/bin in the $PATH. From what I understand, running .profile in your script will not work either because variables are exported to sub-shells, not to the shell above. You can call your script with a dot like . ./script which means that the script will run like it was typed at the command prompt. But it will be less confusing to define appropriate variables in the script. eg.
    ORACLE_SID=my_instance_name
    ORACLE_HOME=/my_path_to_oracle_home_directory
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    PATH=$ORACLE_HOME/bin:$PATH
    I remember some slightly different way of coding to handle the sqlplus return codes.
    For instance:
    sqlplus -s /nolog > /dev/null <<-EOF
    connect system/manager
    @ssm.sql
    whenever oserror exit failure
    whenever sqlerror exit failure
    EOF
    sql_err=$?
    if [ $sql_err -ne 0 ]; then
       echo "FAILURE"
    else
       echo "SUCCESS"
    fiThe - in -EOF supresses tab's
    Using connect will prevent ps from showing your login credentials
    In some versions of bash the ending EOF needs to be at the beginning of the line to work.
    Edited by: waldorfm on Jul 14, 2010 7:05 PM
    complaining about putting code between code delimiters and forgot myself ;-)
    Edited by: waldorfm on Jul 14, 2010 7:08 PM
    Btw, if you "source" a script running it like . .script, than an exit in that script will log you out.

  • Error with dbms_scheduler and shell script execution

    Hi,guys.
    I have an issue with a dbms_scheduler and a shell script execution. So, the shell script as it self works fine, when i'm executing ./test.sh all process is running, but when i'm executing the script from dbms_scheduler it just simply doesn't work. Actually it works, but some of executable information in sh doesn't work, seems it just jump over of the part of the script. Sendmail part is running, maybe there is problem with rman script as it self?
    DB version: 10g
    And my scripts:
    Shell scripts (permisons 755):
    #!/bin/ksh
    export PATH=/home/oracle/product/asm_home/bin:/home/oracle/product/db_home/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.
    export ORACLE_BASE=/home/oracle/product
    export ORACLE_SID=zabbix
    export ORACLE_HOME=/home/oracle/product/db_home
    ${ORACLE_HOME}/bin/rman<<EOF
    connect target /
    run {backup recovery area delete all input;}
    EOF
    {       echo "From:[email protected]"
            echo "To: [email protected]"
            echo "Subject: Recovery area"
            echo 'Content-Type: text/html'
            echo
            echo '<html><body><table border="1" cellspacing="1">'
            echo '<tr><td><b>Process</b></td><td><b>Statuss</b></td></tr>'
            echo "<tr><td>RMAN</td><td><b>Works</b></td></tr>"
            echo "</table></body></html>"
    } | sendmail -tIn the first part i'm exporting all of the important stuff for oracle, then I call RMAN with specific atributes. And then there is just simply sendmail functionality inside script to represent if script works (for now).
    And below pl/sql script:
    begin
      DBMS_SCHEDULER.CREATE_JOB
      job_name => 'FLASH_RECOVERY',
      job_type => 'EXECUTABLE',
      job_action => '/home/oracle/backup/test.sh',
      start_date => sysdate,
      job_class => 'DEFAULT_JOB_CLASS',
      enabled => TRUE,
      auto_drop => FALSE,
      comments => 'FLASH RECOVERY USAGE AREA backup and delete'
      END;
      /And this job execution:
           begin
               DBMS_SCHEDULER.run_job (job_name =>'FLASH_RECOVERY',use_current_session => TRUE);
           end;What can be wrong? For me, I think it's something with permisions.
    I hope you got my idea and could help me.
    Tom
    Edited by: safazaurs on 2013.18.2 22:16

    There is no error, i just receive all the time e-mail, seems it jumps over rman. I tried almost everything and still couldn't get result as i want. And, if i'm running script from command line - it works. Rman calls, and starts to recover archivelogs.

  • How to deal with multiple language SQL script?

    Hi All,
    We now want to create a SQL script that contains multiple languages(English, Chinese, Japanese), this script need to be run at there different database installed on different OS, for example, Oracle9i on Windows 2000 English Edition/Chinese Edition/Japanese Edition.
    If I save the file as ANSI format, this file will only be recognized at local OS(e.g. the Chinese and Japanese character will not be normally displayed on other OS, if I run the script, the CH/JP characters will not be stored normally in DB).
    If I save the file as Unicode format, this file can be recognized by all three OS, but Oracle SQL Plus will not recognize it, thus we can't run the script.
    Who can tell me how to deal with this issue? Is it possible to save only one script that can run on different language OS?
    Thanks,
    Spark

    Hi,
    The ISQLplus supports multiple languages, but there will be following problems for my case:
    1.ISQLplus don't support Unicode format script too, so I must save the file as ANSI format.
    2.To display the characters normally depends on the database server's platform. I create a script contain three languages with ANSI format in Chinese OS, but if I want to load this script to database server installed on English OS via ISQLplus, the Chinese characters will not be displayed normally too.
    PS:
    So, I think this is not only related with Oracle but also the Windows OS, it is hard to create one file with ANSI format that can be displayed normally in different platforms.
    Thank you all the same,
    Spark

  • Problem with the run_job,shell script with sqlldr

    Hi Gurus,
    I Created a job which calls the shell script and i understood from the other posting this job is going to execute with nobody,
    I had done the below testing
    Test 1) Shell script calls the SQL file, this SQL file executes the procedure.
    Test 2) Shell script calls the sqlldr command.
    When i execute the Test cases with , dbms_scheduler Run_job procedure, Test1 is success but Test2 was failed
    When i execute the Test cases with, logging into box with owner of the shell & both test cases are successful.
    Parent folder & Shell files are given with 777 permissions. & the Oracle db is version 10.2.0.1.0.
    Error:
    STANDARD_ERROR="SQL*Loader-522: lfiopn failed for file (*.log)"
    Please provide me your inputs its bit urgent Thanks a lot for your help.
    Edited by: 926769 on May 23, 2012 2:27 PM

    First of all let's look at your environment ... a totally unpatched version of software that is so old it is in desupport mode. You should upgrade to a fully supported version but, if you can't, at least to 10.2.0.5.
    That said without seeing any of your code, or a listing showing permissions on the directory and files, there is insufficient information from which to help you.
    Please post ALL information required for us to understand what you are doing an your environment.
    But before I decided that NOBODY was doing anything ... I'd shell out to the server from SQL*Plus using the HOST command and verify that permissions are as you believe them to be. There is every reason to believe SQL*Loader is having an issue with your file as identified.

  • Accessing concurrent prg parameter values having space in shell script

    Hi, I have a CP that is tied to Host (shell script). One of the parameter values of CP contains spaces. When I print this parameter ($5) in shell script, space is taken as terminator and it parses it in mutiple postions, like if value is "Hello There" then $5 comes as "Hello" and $6 comes as "There"
    How do I access whole values including space as one parameter value?
    Regards,
    Harish

    Hi Ashutoosh,
    OS is SunSolaris 5.9
    My problems was that if I pass a value from concurrent program that has space and wanted to access that value in shell script as one parameter, it won't allow.
    I did anlaysis on this and I think for now, there is no way out. If I pass values from unix to shell script it works, because I will enclose in quotes.
    I removed the spaces while passing value from Concurrent program and was able to achieve what I wanted but its an work around.
    Thanks,
    Harish

  • Problem with running Bash shell scripts

    I am unable to run Bash shell scripts on the UNIX Terminal application.
    This is the transcript from the Terminal application.
    Zhi-Yang-Ongs-Computer:/Applications/MetaPost/metapost-1.102 zhiyangong$ ./test1.sh
    dyld: Symbol not found: _BC
    Referenced from: /usr/local/bin/bash
    Expected in: /usr/lib/libSystem.B.dylib
    Trace/BPT trap
    Zhi-Yang-Ongs-Computer:/Applications/MetaPost/metapost-1.102 zhiyangong$
    Is this a problem with the the default installation of the Bash shell? Can I install the Bash shell on my own? If so, how can I do that?
    Also, how can I get the dynamic linker, dyld, to refer to the symbol "_BC"? What does this symbol "_BC" refer to?

    This was in your posted output:
    /usr/local/bin/bash
    You are NOT running the default bash, you are trying to run a private copy.
    The default Mac OS X bash is located at
    /bin/bash
    Try the following:
    /bin/bash ./test1.sh
    Does that work?
    What is the first line of your script? Is it:
    #!/bin/bash
    Or maybe
    #!/usr/bin/env bash
    /usr/bin/env would find the first bash in PATH . I find this most useful for finding perl on different systems, but sh, ksh, bash, zsh, csh, tcsh are all generally found in /bin so I do not bother using /usr/bin/env
    And if you have
    #!/usr/local/bin/bash
    Then the person that wrote test1.sh choose to use something besides the default bash
    Or maybe this script was transferred from some system where you needed to put your own copy of bash in /usr/local/bin because the vendor does not distribute bash
    Then again, you have not showed us what is inside your script, so it is possible something in the script called something else which invoked the /usr/local/bin/bash
    If that is the case, then you might try:
    /bin/bash -x ./test1.sh
    which should show you the commands executed before it died.

  • Starting Java Program with a bash Shell script

    Hi !
    I know this is a Linux query but I am putting it on this site to get different answers.
    I want to start my Java program with a shell script. Can anybody give me a proper script to start my Java program?
    I am using RH Linux 7.3 and JDK 1.4.
    Can I start the Java program without starting the terminal? Just like the Sun One Studio4 'runide.sh' script.
    Please help.
    Bye Niteen

    assuming you have your PATH and CLASSPATH variables set correctly, your script should look like this:
    #!/bin/bash
    cd <project_dir>
    java <class> &
    example:
    #!/bin/bash
    cd ~/projects
    java project1.main_package.MainClass &
    of course you could add some more elaborated stuff like compiling files before running the program, etc.
    if you dont like terminals, try running "nautilus" (it's like Windows Explorer). i never use nautilus (especially for running scripts), so i cant guarantee it will work, although i dont see why it shouldnt...

  • How to tell if item is a folder or volume with applescript or shell script?

    I am working on a service in Automator that will eject the selected drive when it is finished. Unfortunately automator can only tell the difference between files and folders for the service menu.
    Im wondering if if i can use an applescript or shell script that would check if the selected folder is a volume or folder and quit the action if its a folder. I figure the best way to do this is have it determine if the items path is in /Volumes/, but i am completely new to the process and have no idea how to do this.
    My automator workflow looks like:
    Ask for Confirmation
    Get Selected Finder Items
    Shell Script
    I have the path of the folder selected being passed into the shell script, but after its in there i dont know how to determine if its a volume or not.
    Thanks!

    K T,
    I completely missed that section of the forums, sorry
    Neil,
    I had that kind of script set up but it was like this:
    on run {input, parameters}
    tell application "Finder"
    kind of item parameters
    end tell
    end run
    And i just figured out that i had to change the first line to "on run {parameters}" and now it works great.
    Thanks for the help, it got me going in the right direction

  • How can i avoid Errors by folders with spaces in the script

    Hello!
    I have written (or better to say gathered) a script which should fix a problem in a network. Let me explain first what it should do.
    Let's say we have a folder named Test with a lot of subfolders, one for each user of the network, which also contain many, many subfolders. The problem is that some user accidentally Drag and Drop subfolder into other subfolder. (E.g. D:\test\userA
    is now in D:\test\UserB\UserA). And the next time User A wants to open his folder: It's gone. I really hope you can follow me because i am a little confused by myself right now. :)
     And here is the thing, a VB Script with Icacls that change the User-Authorization in the first Level of Subfolders, so that they can't Drag and Drop anymore, though they have Full access to the content of the folder. So far my script works as far as
    there a no spaces in the Foldername.
    D:\test\UserA works.
    D:\test\User A doesn't.
    Here is my Script so far (i am german, so pls don't bother on the german names):
    Dim objFSO, strLogFile, objLogFile
    Const ForWriting = 2
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    strLogFile = "D:\dir_log.txt" 'Log File to show what was changes
    If objFSO.FileExists(strLogFile) Then
       set objLogFile = objFSO.OpenTextFile(strLogFile, ForWriting, true)
    Else
       objFSO.CreateTextFile(strLogFile)
       set objLogFile = objFSO.OpenTextFile(strLogFile, ForWriting, true)
    End If
    read_two_subfolders "D:\test",objLogFile, 0 '
    objLogFile.close
    function read_two_subfolders(strFolderPath, objLogFile, intCounter)
    On error Resume Next
    Dim objUnterordner, objFolder
    if intCounter < 1 then 'Number of Subfolderlevel which should be changed
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strFolderPath)
    For each objUnterordner In objFolder.SubFolders
      objLogFile.WriteLine objunterordner.path
      read_two_subfolders objunterordner.path ,objLogFile, intCounter + 1
     Dim strFolder, strUser, strDomain
    strFolder = objunterordner.path
    strUser = "Testuser" 'User or Group
    strDomain = "Testdomain" 'Domain (should be left empty at local domains)
    SetPermissions    
    SetPermissions()   
     Dim intRunError, objShell, objFSOO    
     Set objShell = CreateObject("Wscript.Shell")   
     Set objFSOO = CreateObject("Scripting.FileSystemObject")  
     If objFSOO.FolderExists(strFolder) Then       
      intRunError = objShell.Run("icacls " & strFolder & " /inheritance:r /grant:r " & strDomain &"\" & strUser & ":RX ", 2, True)                
      If intRunError <> 0 Then           
       Wscript.Echo "Error assigning permissions for user" & strUser & " to folder" & strFolder       
      End If   
     Else       
      Wscript.Echo "error: folder" & strFolder & " does not exist."   
     End If
    Next
    End if
    End Function

    Hi LW,
    while I don't always see eye-to-eye with JRV, I really have to agree with him on this: Trying to make this work would probably be an act of futility. I highly recommend trying to learn powershell and do it there. Here are some links to commands that will
    get you started on your problem:
    Get-Help
    Get-Member
    Get-ChildItem
    Get-Acl
    New-AccessRule
    Set-Acl
    For producing something to order, you're best recourse is indeed a consultant however. I'd say this is more of a fish problem: Give a man to fish or teach him how to fish, so I highly recommend learning the skills for yourself. Your own skills will never
    abandon you.
    Cheers and good luck,
    Fred
    There's no place like 127.0.0.1

  • [SOLVED]Would be grateful for help with im notification shell script

    Hi all,
    Playing with finch (a console im client), and haven't found any notification plugins for it that work the way I want.
    What I have been doing is using tail to watch the logs. As the logs are in html, I use sed to strip the html tags:
    tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g'
    I would like to use notify-send or dzen2 to create popup windows when the log file changes, but I'm not sure how (I am not an experienced programmer).
    This, for example, does not work:
    tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g' | while read line ; do notify-send "${line}" ; done
    Removing sed from the stream above allows notify-send to pop up notifications. How can I have the same happen with sed in there?
    Last edited by hellomynameisphil (2011-10-22 17:49:34)

    hellomynameisphil wrote:
    tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g' | while read line ; do notify-send "${line}" ; done
    Removing sed from the stream above allows notify-send to pop up notifications. How can I have the same happen with sed in there?
    The problem here is that sed is buffering its output to improve efficiency in pipes. Try with:
    tail -n 1 -q -f ~/.purple/logs/bonjour/phinch/*/* | sed -e 's#<[^>]*>##g' -u | while read line ; do notify-send "${line}" ; done
    And should work as well
    Regards

  • Help with logic in shell script

    I am on solaris and i have this piece of code.Im using Oracle 10gr2
    Code:
    echo "SQLPLUS CONNECTION"
    sqlplus -s $ARBOR_USR/$ARBOR_DB_PASSWD@$ORACLE_SID<<EOF>$CUR_DIR/sql_output.txt
    set feedback off
    set heading off
    select distinct account_no from adj  WHERE ADJ_TRANS_CODE=-2401 and request_status=1 and bill_ref_no=0
    order by account_no;
    EOF
    if [ $? -eq 0 ]
    then
    echo " SQLPLUS Connection Successful "
    else
    echo " SQLPLUS Connection Failed "
    fi
    ##echo " The account numbers passed to   BIP are  "
    if [  ! -s  "$CUR_DIR/sql_output.txt" ]
    then
    echo "No account number for bad debt"
    else
    for i in `cat $CUR_DIR/sql_output.txt`
    do
    sqlplus -s $ARBOR_USR/$ARBOR_DB_PASSWD@$ORACLE_SID<<EOF1>$CUR_DIR/sql_interim.txt
    insert INTO  t_bill(ACCOUNT_NO,INTERIM_BILL_DATE,INCLUDE_ADJ,PAYMENT_DUE_DATE,TRACKING_ID,TRACKING_ID_SERV )
    select $i,trunc(sysdate),1,trunc(sysdate),0,0 from dual;
    EOF1
    echo "bip $i is running"
    sh  $SCRIPT_DIR/bip.sh 01 0 $i >  $CUR_DIR/bip_log_1.txt
    sleep 200
    done
    fi
    I want to insert the account number into t_bill.TRACKING_ID,TRACKING_ID_SERV columns are composite primary key in the table t_bill.
    The logic behind this is that
    Only 1 row is to be inserted into t_bill table then the bip.sh script runs for a particular account number .When the bip.sh runs the entry for that particular account number
    is deleted from t_bill automatically.
    How to implement this logic? Please correct my above code.

    Through this sql statement i will get few account numbers daily
    select distinct account_no from adj  WHERE ADJ_TRANS_CODE=-2401 and request_status=1 and bill_ref_no=0 
    order by account_no; 
    For eg : i get 3 account numbers(i.e) .
    My main motive :-NowI need to insert 1 account number in  t_bill .
    TRACKING_ID,TRACKING_ID_SERV columns are composite primary key in the table t_bill.I have hard coded it 0,0
    bip.sh is parametrized script taking one account as parameter.
    When i execute the bip.sh the entry of that account num from t_bill is deleted automatically
    Steps i need to implemet
    1.get the account numbers
    2.insert 1 account into t_bill
    3.run the bip.sh for that account number
    i need to do the same process for all account numbers

  • Runtime.exec with a unix shell script

    I've done a lot of google'ing and haven't found a definitive answer to my question, including the JavaWorld article that is pointed to quite often. Scenario1 - The program calling Runtime.exec is running in /dir1 and I have a script called test.sh in /dir2 (neither directory are in the path). If I call Runtime.exec("test.sh", null, "/dir2"), I get java.io.IOException: test.sh: not found. However, if I do "touch test.sh" AND "chmod +x test.sh" in /dir1 and call the same exec, it works AND runs the script in /dir2 not /dir1?!?! Also, if I copy /dir2/test.sh /dir1/test.sh and I call exec("test.sh"), it works fine. Scenario2 - If I get rid of /dir1/test.sh and call exec("/dir2/test.sh", null, "/dir2") OR exec("/bin/sh test.sh", null, "/dir2") - both of those work. I just don't get Scenario1. Why does having the dummy executable test.sh in /dir1 allow it to run in /dir2 OR if the script is in the local directory of the process calling exec, why does it work without adding the path? It doesn't seem consistent. Seems like the working directory I specify isn't set before trying to run it or something. On the flip side, if I have a java class in /dir2 called test.class, I can call exec("java test", null, "/dir2") and it just runs without jumping through any hoops - although I think the explanation for that is that "java" is in the path. Let me know what you think.
    Gary

    I think the problem is that the three argument version of exec specifies the command to run (should be full path to it if it is not in the current dir), the environment, then the working directory. The working directory will not help java to find the command to run in the first place. The following does work as you say:
    Runtime.exec("/bin/sh test.sh",null,"/dir2");This is because the full path to the command (/bin/sh) is specified, that runs in directory /dir2 then tries to find test.sh which it finds there.
    Basically to run anything, you should specify the full path in the command, the working directory will not help java find it.
    Dave

Maybe you are looking for

  • Delete song from iphone that's not in itunes

    i have a song in my iphone that is not in itunes i would like to delete. how do i do that? i orginally purchased it from itunes but later, i guess, deleted it from itunes.

  • Network Chat for Mac AND Windows

    Hey there Is there an chat app for mac that works on windows as well?? Like iChat can support bonjour but is there a similar app for windows that works with iChat?? THanks Luke

  • How does one enter special characters, in particular french accents into text in PS Elements?

    I'm trying to produce some artwork in Photoshop Elements with some French text in it, so I need to know how to input special characters for the letters with accents. Anyone got any ideas - I've tried looking for a glyph menu but that doesn't seem to

  • Itunes on New PC

    I recently "refreshed" to a new PC at work. My iTunes library ( from my old pc)came up on the new laptop...however, now ,when i purchase new music...it will not update to my iPod. Non-purchased music updates just fine. It seems like iTunes Music Stor

  • T540p+UltraDock+external display

    Hi,  I'm having problems with T540p with latest bios update.  I'm using Dell U2713hm with ThinkPad Ultra Dock 135W (40A20135XX) i have both the 170w and 135w adapters for dock. and my dock has a 2.22.000 firmware.  I have updated my nvidia and intel