How could I get unix shell variable value?

I want to get a unix shell variable value because I will use it in my java program. For example $HOME, I have wrote like below,
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("echo $HOME");
But I could not get $HOME value, just get "$HOME" as result.
Why could not I get the value?

Other than passing them as params to your program, the only way to read them runtime is either pipe them thru a stream or use JNI.

Similar Messages

  • How to use an UNIX shell variable in sql where clause

    Hi ,
    In my shell script first I get the Date and time from the system into the shell variable.At the end of the shell script I need to run a sql script in which I want to use the variable value in the where clause . Is there any way we can use a shell variable value in SQl script ?. Any help is greatly appriciated .
    Thanks in advance,
    Sampath

    Try the following
    In Unix
    SQLPLUS <username>/<password> @MyScript.sql <UNIX_Variable>
    In SQL*Plus
    Reference the variable as &1
    select *
    from MyTable
    where MyDate = to_date('&1','<date_format>');

  • How to get BW-BPS variable value into Visual Basic?

    Hello,
    Scenario:
    Time characteristic 0FISCYEAR has a variable ZVFYEAR. In layout this time characteristic is defined as DATA COLUMN. When user changes VFYEAR variable’s value i want to get the value of variable into Visual Basic and to format header for table in the layout.
    How to get BW-BPS variable value into Visual Basic?
    Could you help me?
    Thanks in advance.
    Best Regards,
    Arunas Stonys

    Hi,
    If i understand your requirments correctly ,you need to read the value of the Variable and Put it on the layout. Here is how  i would solve this,
    Read the value of the variable using an ABAP program.The logic for this would be to read the variable value and post it on the layout on a cell.You can do this by calling the ABAP program on opening the layout.this can be done using LB_EXIT_FM  T-code. Now using the  SAP delivered SAPAfterDataPut  macro, read the cell in which you have placed the variable values and assign it to the necessary values you want to on the layout.All this will be done before the layout opens.
    Hope this helps.
    regards
    Sai Vishnubhatla

  • Read a Unix Shell Variable

    I need to write some code (i was told its only like 5 lines) that reads the value of a Unix Shell Variable. I searched the forums and found only 1 post on this subject:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=397213
    I'm not sure if this is what i want to do however. my bosses co-worker, told me that i will need to use "System.properties" (i know there is no method System.properites but that is what he said) I looked into System.getProperites, and it just didn't make sence to me why i would be needing anything related to "System.properties". any suggestions on how to do this? (is it really only like 5 lines of code or is it much more complicated than that)
    Nick

    I did a google and found this immediately:
    http://www.javaworld.com/javaworld/javaqa/2001-07/01-qa-0706-env.html
    Google is your friend.
    It also returned a page expanding on the suggestion at the end of that article (using env), but rather than writing it to a file, using Runtime.exec to get an input stream and then sending that to java.util.Properties,
    which isn't a portable solution but doesn't require changing the invocation of the JVM.

  • How Can i retain the Shared Variable Values after PC rebooting

    Hi all,
    I am facing a paculiar problem with Shared Variables. I have an application in which shared variables are used for data communication.
    One of the application requirement is to retain the variable values eventhough PC is rebooted or started after crashing. 
    As per the my understanding, the variable values will retain eventhough the PC is rebooted. But here i can observe a paculiar problem like some library variables are retaing the values while some others not. I enabled logging for all the variables.
    I tried many ways. like logging enabled, logging disabled, changing variable names, changing process names etc... But i am not getting a consistent behaviour.
    I hope some you can help me in solving this issue.. "How Can i retain the Shared Variable Values after PC rebooting"
    Thanks and Regards,
    Mir

    Hi Blackperl,
    Thanks for the post and I hope your well. 
    What do you mean by not getting consistent behaviour.. this will all depend on excatly when the crash happens i.e. before the write or after. 
    Surely a better method would be to log the data to a file during the reboot...
    I beleived the value read back
    will be the default value for the shared variable's data type.
    The LabVIEW DSC 8.0 module adds more functionality to the shared variable, including initial values and alarms.
    If you enable an initial value on a shared variable, when the variable
    engine comes back on-line it will default to this value. Setting a bad
    status alarm for the shared variable is also a good way of handling
    this type of event. Additionally, if you are using a LabVIEW Real-Time
    target such as Compact RIO or Compact FieldPoint, it is appropriate to
    consider hosting the shared variable engine on the real-time target.
    These devices have watch-dog capabilities and are typically the
    hardware controlling the critical pieces of an application. Most
    Windows or PC-based targets do not have these fail-safes.
    I guess, if you could explain to me again that would be great. From my point of view, if I have a cRIO and a Windows PC. If the windows PC crashes, the cRIO will still update its shared variables. Then once the PC has started up its own shared variable engine, and the bindings are loaded, it will once again continue to update its copies of the variables.
    Please let me know what you think,
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • How  could i get my array to do this?

    how could i get my array to print out in this format
    1 A B C D
    2 A B C D
    3 A B C D
    4 A B C D
    5 A B C D
    6 A B C D
    7 A B C D
    i tried this in a small function
    public void showArray()
            char[][] temp= new char[7][4];
            for (int i=0; i<array.length;i++)
                for(int j=0;j< array.length; j++)
    temp[i][j]=array[i][j];
    System.out.println( temp[i][j]);

    public static void printArray(char[][] array)
       for (int i=0; i<array.length; i++)
          System.out.print(i +1 + " "); //print the row number + 1, then a space
          for (int j=0; j<array.length; j++)
    System.out.print(array[i][j] + " "); //print the value at row i and column j, then a space
    System.out.println(); //print a new line
    }Edited by: chickenmeister on Nov 11, 2008 9:47 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID and  accound now my husband can see all the text I send and I get everything he gets how could I get his phone out of my accound

    I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID and  accound now my husband can see all the text I send and I get everything he gets how could I get his phone out of my accound

    Mishijos3 wrote:
    I have and iPad and I have and iPhone 5 my husband has another one and I singed all of them with the same Apple ID ...
    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • How could i get the selected node in the JTree

    getLastSelectedPathComponent() �returns the parent node of currenr selected, so how could I get the selected node itself in the JTree
    I will appretiate for any help!

    i think you can get by....
    TreePath treePath = tree.getSelectionPath();
    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();

  • HT1414 after update of ipod touch ,,how could i get my music n videos back

    hii i am using ipod touch of second generration afte update of ipod how  could i get my videos n music back again into my ipod

    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How could i get access to MDM API,Is it available to all Enterprise accounts?e

    Hi ,
    I am trying to develop an enterprise application which needs to list all the installed Enterprise apps in the device.Also there is an option to delete the installed enterprise apps from device.I found that this can be done only by setting up a customized MDM server.My company already has an enterprise account.I have some doubts related to this
    1 . Is it possible to setup a custom MDM server using MDM API's?
    2. How could i get access to MDM API's to setup a custom MDM server/
    3. Is MDM server provided only by third party vendors?
    4. Is MDM server /MDM API available to all enterprise accounts?
    Looking forward  for a quick response.
    Thanks in advance

    A backup of a device with a newer version of iOS cannot be retored to a device with an older version.  The solution is to connect to itunes and update the new device's iOS, then perform a restore.

  • How can I get rid of the values shown on x axis

    How can I get rid of the values shown on x axis ?
    The two diagrams are for illustrations .I want the A diagram like values and wanna get rid of 50 150 250 350on x axis
    Mudassar

    In Axis Options, set Interval to 1. Every category group label
    is displayed. If you want to show every other category group label on the x-axis, type 2.
    "If you want to show every other category group label on the x-axis, type 2."
    what does this mean ?
    when you set 1 as per it everything is shown and when you set 2 every other ????
    Any example on this ?
    Mudassar

  • How could i get the dump/restore utility?

    I am newbie to arch, a stupid question
    when i use FreeBSD or other Linux Distribution, dump/restore is always the standard utility
    but i do not find them in pacman
    how could i get the dump/restore utility?
    thanks

    fukawi2 wrote:
    Ranguvar wrote:dump and restore are deprecated in Linux IIRC. Other utilites are available. There's even a quote by Torvalds where he disses them
    There's nothing wrong with the classics
    I think so

  • How could i get the status of Purchase Oder's status

    Hi, Great ALL!
    Can you tell me, what I can to do.
    I need to do some check at purchase order in checking or saving time.
    If there are any mistakes, system could set some warning message or error message(like the following pictures:)
    1.[http://lh5.ggpht.com/dingdinghaochibao/SP3QkVca4VI/AAAAAAAAAHA/GjAd5ksg3Og/s576/Picture1.JPG]
    2.[http://lh3.ggpht.com/dingdinghaochibao/SP3QkeJgx1I/AAAAAAAAAHI/DfE6mvIOpm8/Picture2.JPG]
    Here is my question: How could i get those messages?

    a®s
    Thanks for your answer.
    But i still have one question. After i made a purchase order although there were one warning message given by system, i could not find any log by TR. SLG1.
    Is there any way to get those message by BAdi or exit?

  • Dear Customer Service Team,  I bought a twelve-month Dreamweaver CC program with monthly payment that I have paid via bank transfer and there would be a question about the activation. How could I get the license key with which I can activate my account? I

    Dear Customer Service Team,
    I bought a twelve-month Dreamweaver CC program with monthly payment that I have paid via bank transfer and there would be a question about the activation. How could I get the license key with which I can activate my account? I can not find it and now I only have access to the trial version.
    Thank you for your help in advance.
    Kind Regards,
    G. Zsolt

    There is no serial number require for Creative Cloud products, you may activate the products using your email address and password which is associated with Adobe. If your Dreamweaver asking for serial number, then make sure you are signing in with correct email address.
    You may also refer below link
    Sign in, activation, or connection errors | CS5.5 and later

  • HT204053 I don't see Icloud under my setting, how could I get it?

    I don't see Icloud under my Mac settings, how could I get it?

    iCloud does not appear in System Preferences on Snow Leopard. The minimum requirement for iCloud is Lion 10.7.2 - as this has been superseded by Mountain Lion you would need to upgrade your Mac to that, having first checked that it meets the requirements as listed here:
    http://www.apple.com/osx/specs/
    The only thing you can do with Snow Leopard is to access iCloud mail on an account which has already been set up:
    Entering iCloud email settings manually in Snow Leopard or Leopard
    and possibly sync calendars (though this is a hack and not necessarily reliable) as mentioned in this page:
    iCloud and Snow Leopard

Maybe you are looking for