How to open another program in unix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Manish Shimna
    New Member
    • Feb 2012
    • 1

    How to open another program in unix

    How to open an application using unix script ?
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Just call the binary with whatever options you want. The below script calls the application 'ifconfig.'

    [code=bash]
    #!/bin/bash
    # shell script to show how to call a program
    # in this case, call ifconfig to set ip
    # by: sicarie 2012-02-28

    #calling ifconfig
    /sbin/ifconfig -i eth0 192.168.0.10

    #done[/code]


    Most binaries are in /bin, /sbin, /usr/bin, or /usr/sbin. There are a few other places, but you should be able to locate them with either the whereis or the find commands.
    Last edited by sicarie; Feb 28 '12, 10:48 PM.

    Comment

    • no2pencil
      New Member
      • Mar 2012
      • 4

      #3
      Most binaries are in /bin, /sbin, /usr/bin, or /usr/sbin.
      If the application is installed in a global location accessible by the user, the program 'which' will return the binaries location.

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        I'm constantly surprised by the wealth of 'find' programs in Linux - and 'which' is another great option for determining the absolute location - thanks no2pencil!

        Comment

        Working...