What unix commands are guaranteed to exist for exec?

hi,
does anyone know if there is a list of commands that are common to all unix platforms, that you could call from a Runtime.exec?
I'm interested in 'hostname' and 'which' at the moment
thanks,
asjf

When you do exec(), no environment variables will be passed to the
commandline you are executing, so "/usr/bin/which" would not work,
since it uses PATH env variable. If you want, you can pass
the environment through one of the overloaded exec
calls.that was my understanding too, but doing
Runtime.exec("/usr/bin/which which")
returns
"/usr/bin/which"
or even doing just Runtime.exec("which which") gives the same result
maybe the JVM is being helpful somehow? (although I still don't understand where /usr/bin/env is getting its environment variables from?)
Most of the common unix utilities are in /usr/binthanks! theres quite a lot of them..

Similar Messages

  • HT4759 what hardware is/are used in order for the Apple: iCloud to run?

    what hardware is/are used in order for the Apple: iCloud to run?

    Apple - iCloud - Learn how to set up iCloud on all your devices.
    More Info Here  >  http://www.apple.com/support/icloud/

  • REMSH unix command issues when adding rule for port 514

    Has anyone experienced any issues with Unix systems when adding rules to WAAS for port 514? This is the port RCOPY uses and is not handled by WAAS by default. We created a rule for port 514 but when we implement any type of optimization (even TFO Only) we start having problems with REMSH. This is used in one of our production scripts that normally take 10 minutes to run. When we apply the rule for port 514 the time goes as high as 45 minutes.
    We wrote a test script that uses just the REMSH command and with out the 514 rule works fine but with the 514 rule goes down the tubes.
    Just to add a little more information, I do not see an entry under Monitor/ Connection Statistics with the servers in question when the test script is running so am not sure where to go from here. I know there is a way to do a TCP capture from the WAAS so figure that will be the next step to see what is causing the issues.
    Thoughts?? Ideas?? Suggestions??

    Well TAC came back with a answer. They found other people with the same issue.
    "It was found that the applications always used the same source and destination TCP ports. WAAS has the first connection in a "WAIT-CLOSE" state so when the next packet comes in with the same ports it is dropped." , "A defect was opened for this issue, but has not been fixed yet."
    He wanted us to do a packet capture but after finding these other tickets decided it would be a waste of time and only tell us we are having a similar issue as others.
    Still waiting on a suggested work around or a patch, 4.15 is suppose to come out soon but haven't heard if it will fix the problem.
    With the new information I don't think even putting 514 in pass-through will fix the issue.
    I will let you know if I hear anything else.

  • What Unix command is used to assert a file or folder's color label assignment?

    I'm doing some scripting to automate processes on my XSan.  One of the functions I find I'm doing over and over frequently is changing file ownership, permissions, changing the color of the parent folder based on the status of the files in it, and then locking the file.  I know the UNIX equivalents for three of the four commands:
    chown-- for the file ownership
    chmod-- for the permissions
    chflags-- for the lock bit
    but I've been looking through man pages all day and can't find what command asserts the file or folder's "label" color attribute.  I'd rather do this in command line that in Automator, as it's faster and I have hundreds of folders containing files that I need to lock down.  My boss is considering replacing XSAN with Compellent, and I'm trying to show how easy MacOS is to manage when you can script everything involved in maintaining it.  This will go a long way towards making that case.

    Wrong forums. Try https://discussions.apple.com/community/mac_os/mac_os_x_technologies#/?tagSet=10 48

  • Unix command to stop Software updates for all users except admins?

    I want to stop App Store and other software updates for all user accounts. Administrator accounts should still be able to do Software Updates.
    Is there a terminal command that can do that i can push out through ARD?
    Thanks

    Managed preferences are the best bet. You could use Profile Manager or use the mcx command from the command line. I'd strongly suggest browsing over this before delving into MCX though...
    http://macadmins.psu.edu/2011presentations/PSUMAC301-MCX-John_DeTroye.pdf
    (the Workgroup Manager application shown is deprecated, but it's essentially the same with Profiles and running MCX from the command line)

  • What privacy settings are most people using for Adobe Flash Player and why?

    Can anyone tell me what most people use for a  privacy setting in Adobe Flash Player. I feel as though i want to use the "block all sites" option but i don't know if that is wise. Can anyone offer advice?
    Thank you,
        TomS

    Can anyone tell me what most people use for a  privacy setting in Adobe Flash Player. I feel as though i want to use the "block all sites" option but i don't know if that is wise. Can anyone offer advice?
    Thank you,
        TomS

  • What 3G Cellular Data Carrier options exist for an iPad 1 Model MC497C?

    Bought in Canada at an Apple Store.  Bought a Bell Sim card with it at the time of purchase.
    The credit card on the automatic pre pay expired.  Wasn't using 3G very much, so I never updated the card.
    Now I go to add time to the plan, because I will need 3G and it appear Bell tells me that "This option is not available for your service profile. To view the latest products and services from Bell, visit bell.ca."
    I go to Bell.Ca, and try to login using the email address that was associated with the account.  The Bell web server "seems" to log me in and then times out.
    I'm hoping that there are other carrier options out there.  As far as I'm concerned I've wasted enough time trying to get this thing going with Bell again--Why they make it so difficult to revive a profile I don't know.
    Any information anyone can provide would be appreciated.
    Butler.

    Check this list of carrier:
    http://support.apple.com/kb/ht1937

  • What Vaio Models Are The Updated Drivers For Windows 10 Going To Be Compatible With?

    I have a Sony Vaio (Model Number: VPCEJ16FX) and am wondering what models of Vaio will be supported by the updated drivers?

    I understand that Sony is not to support endless models of the computers that have been placed by them out on the open market, however Microsoft itself has found a need to include windows 7 computers within their list of computers eligible for a free upgrade. As such, when Sony tells us that they will not participate in the upgrade, they essentially tell me that if they create a product that fails, that they will not support it at all, and leave all their loyal customers to fend for themselves. I have been a long time supporter of Sony and have unbelieveably been an ambassador for their company, for years since I was a child, I owned Sony Walkmen, minidisc players, DVD players, televisions, ALL OF MY COMPUTERS EVER WERE SONY, sony rewards, sony wheelers (wheel of fortune) club, Countless car stereos, home stereos, Sony dream machine alarm clocks in every room, playstation, PS2, PS3, periferals, cases, Imagestation, Sony eMarker, many of which have failed, and we accepted those failures in fact and still continued on supporting your innovation and knowhow because you continued support or somehow some way still found a way to make things right, KEEPING OUR LOYALTY!!!! And now we find ourselves here, a company that's failing little by little, when I see that they do not support drivers for computers they built NOT THAT LONG AGO, and which Microsoft themselves will support, it makes me wonder. Why should I continue with a brand that keeps facing triumphant failures and doesn't seem to care anymore about the people reliying on what products the company has put out on the market? Is this the beginning of a trend we will see from now on? I REALLY REALLY hope not. You make great products but when something goes wrong if you do not support it and make it right, you're worthless. Why? Because something eventually goes wrong with even the best of things, and you need to learn again how to make things right. Windows 10 has been in the works for some time now, and I know that Sony still had access to developer models for almost a year now, and yet still we have to wait another month. I expect nothing but the best from this company, because they set the standard so high. Glass half full, you built me a fantastic computer that still works great everyday! You need to support and recognise that, use it as a testament, an advertisement that you build great things, keep your flame alive, keep supporting, improving, developing and innovating, and you will find your numbers will turn around. I hope to see some Win 10 drivers, patches, SOMETHING available in the not too distant future that somewhat mirrors what microsoft is ready to support. Thank you. 

  • What monitoring features are available in OEM12c for monitoring OSB

    Hi All,
    I want to monitor Oracle Service Bus with OEM 12c Cloud control. Can anyone tell me what exactly can we monitor in OSB with OEM. Do we have any document on this?
    thanks in advance!!

    EM12c monitors OSB similar to the way it monitors SOA suite. You can monitor, diagnose and do lifecycle management of OSB artifacts from EM12c. I see that you have another thread open where you aren't able to discover OSB services correctly. I can help you fix that problem and then you can explore all of OSB management from EM12c. This doc can get you started: http://docs.oracle.com/cd/E24628_01/install.121/e24215/disc_mon_osb.htm#BGBCHCCF

  • What screen resolution are all of you designing for?

    I realize a liquid layout is ideal, but even liquid layouts have an "ideal" resolution the design is built around.
    What minimum width are you guys designing for? (ie, 960px for 1024px resolutions)

    BobLevine wrote:
    Depending on the design I use anywhere from 950 to 1000 pixel widths.
    Bob
    Thanks for your answer. Mind if I pick your brain regarding these choices?
    By my calculations (using latest Windows + latest IE, which represent the majority) the window border occupies 8px on each side.I just measured it a few seconds ago.
    The scrollbar occupies an additional 17 pixels on the right side.
    Total : 33px of the horizontal viewable area is taken up by the browser.
    This would mean that when catering to 1024 screens - which you clearly are - the sweet spot would be 1024 - 33 = 991 pixels max with a borderless design (ie, margin:0 on the body).
    Knowing this, why would you ever use 1000px wide? If you were catering to 1280, then you'd want 1280 - 33 = 1247 pixels max. Or are you referring to centered designs that don't scroll?
    Is there a conscious and calculated reason why you'd limit yourself to 950px when you've got 40 more to work with, or why you'd unnecessarily force a horizontal scrollbar on all 1024 screen resolutions by designing @ 1000px?

  • Running unix commands from within a procedure

    Oracle 11.1, AIX 6.1
    ================
    A developer would like to know what the commands are to execute from within a procedure to run unix commands on the database server and capture those results back to the procedure for parsing & manipulation.
    Thanks.

    Don't take this as the correct way to do it, but this is merely 'a' way to do it:
    have a db procedure thats executes a db function
    create or replace procedure csproc(p_cmd in varchar2)
    as
    x number;
    begin
    x:=csfunc(p_cmd);
    dbms_output.put_line('x is: '||x);
    end;
    /The function calls a piece of java to execute the os command and return the return code of the os command
    create or replace function csfunc( p_cmd  in varchar2) return number
    as language java
    name 'csclass.RunThis(java.lang.String[]) return integer';
    /Here is the java class to run the os command
    create or replace and compile java source
    named "csclass"
    as
    import java.io.*;
    import java.lang.*;
    public class csclass extends Object
    public static int RunThis(String[] args)
       Runtime rt = Runtime.getRuntime();
        int        rc = -1;
        try
           Process p = rt.exec(args[0]);
          int bufSize = 4096;
           BufferedInputStream bis =
           new BufferedInputStream(p.getInputStream(), bufSize);
           int len;
           byte buffer[] = new byte[bufSize];
           // Echo back what the program spit out
           while ((len = bis.read(buffer, 0, bufSize)) != -1)
              System.out.write(buffer, 0, len);
           rc = p.waitFor();
        catch (Exception e)
           e.printStackTrace();
           rc = -1;
        finally
           return rc;
    /and finally the os command - in this case its a very simple shell script
    #!/usr/bin/ksh
    echo "Hi" >> /app/oracle/workdir/cs.logwill have to grant privileges to my user 'CS' to run the various os commands
    exec dbms_java.grant_permission('CS','java.io.FilePermission','/app/oracle/workdir/cs.ksh','read,execute');
    exec dbms_java.grant_permission('CS','java.io.FilePermission','/app/oracle/workdir/cs.log','write');
    exec dbms_java.grant_permission('CS','SYS:java.lang.RuntimePermission','*','readFileDescriptor');
    exec dbms_java.grant_permission('CS','SYS:java.lang.RuntimePermission','*','writeFileDescriptor');and finally can run the procedure from within the db
    set serveroutput on
    exec dbms_java.set_output(1000000);
    exec csproc('/app/oracle/workdir/cs.ksh');
    x is: 0
    PL/SQL procedure successfully completed.to prove it works ok the logfile shows an entry:
    'Hi'

  • Execute unix commands from Java

    Hi,
    I have a client application running on windows. This client should connect to a unix server and check for the existence of a file and display the result as "File found/File not found". In order to connect from windows to the unix server, I used the sockets and the connection is successfully established. The second part is to check for the presence of the file in unix server. I searched in google.com and the option I found to execute a unix command from java is the "Runtime.exec()". Runtime.exec is considered as the less effective (not a favorable) one.
    Is there any other option available (other than the Runtime) to execute the unix command from java? Can you please let me know.
    Thanks a lot
    Aishu

    So, please let me know how I can execute the above unix commands without Runtime.exec()You have a client and a server.
    You want something to run on the server, not the client.
    That means that something must in fact being running on the server before the client does anything at all.
    For example telnet. Or a J2EE server application.
    So is something like that running?
    If not then there absolutely no way to do what you want, even with Runtime.exec().
    If yes then what you do depends on what is running. So Runtime.exec() would be pointless if a J2EE server was running.

  • Unix command to turn "off" caps lock or turn it "on" on lab machines

    Hi,
    I'd like to be able to send a unix command to a lab of panther eMacs. I'm using Apple Remote Desktop 3.2 I would like to send both "turn on cap locks" to all the machines, or "turn off cap locks to all the machines.
    Many of my "Send Unix Command" are applescripts (osascript....) so either a unix command or applescript command would be welcome.
    Thanks!

    Well, I've been busy trying some things and found a beautiful little applescript that will turn off caps lock on 10.4 machines and newer. I'll paste it in below. Here's the problem...
    I can't seem to get it to run in ARD as a unix command. (I put the osascript as first line when I pasted it in... This usually works for sending applescript commands)
    So, any ideas on how to get it to run as a unix command??
    IS THERE ANYWAY TO GET THIS TO WORK ON PANTHER MACHINES?? (they don't have the "modify keys..." button in the keyboards and mice pane of sys prefs). The bulk of our machines (over 300 are eMacs running panther).
    *** script ******
    tell application "System Preferences"
    activate
    set current pane to pane "com.apple.preference.keyboard"
    end tell
    tell application "System Events"
    tell application process "System Preferences"
    get properties
    click button "Modifier Keys…" of tab group 1 of window "Keyboard & Mouse"
    tell sheet 1 of window "Keyboard & Mouse"
    click pop up button 1
    click menu item "No Action" of menu 1 of pop up button 1
    delay 3
    click button "OK"
    end tell
    end tell
    end tell
    tell application "System Preferences" to quit

  • UNIX command to open applications

    I'm looking for a UNIX command to open any application on a client machine.
    I am also looking for a command to set the time of each machine to use a Network Time Server.
    Any help would be appreciated. Thank you.

    open /Applications/path...
    e.g.
    open /Applications/Safari.app
    time server:
    # turn on network time and designate a network time server.
    systemsetup -setusingnetworktime on;
    systemsetup -setnetworktimeserver time.apple.com;
    the time unix commands are available as a template from the send unix command window.

  • UNIX command in ABAP code

    Hi All,
    I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
    Can any one help with how to used unix commands in ABAP?
    Thanks in advance.
    Regards,
    Hemendra

    The recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc.  For example:
    Command name       OS         Type             OS command                                 Parameters for operating system command 
    Z_FILE_MOVE        SunOS      Customer    mv                                                 ? ?   
    You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
    Jonathan

Maybe you are looking for

  • Install windows 8.1 on gpt on a bios system

    Is it possible to install windows 8.1 on a gpt formatted partition on a BIOS or non-EFI system? Where can I locate descriptions for that?

  • Can't see photos after iphone is synced

    after downloading and installing Itunes 10.5, I did the software upgrade (os5).  My phone was backed up and then it asked me if I wanted to restore as a new phone or from backup from the computer.  I selected backup from computer (windows XP).  Sync

  • FaceTime login problem

    I am not able to log into FaceTime after multiple attempts. I am logging in from India. Is there any country specific setup or activation required? Does anyone know about it?

  • App Store Developer Updates Feature?

    I was wondering if there is a way to get automatic email notifications from the iTunes App Store on a regular basis that would let me know when a specific app developer has released a new app(s). For example, maybe if there was a feature on the App S

  • Premiere Pro CC2014 Last Update - Old Project not opend

    after you have the latest update, all of my projects have trouble being open. Premiere timeline and open the file, but I do not see the preview, I do not see the clip in the Monitor. I only hear audio and see nothing. before the update everything wor