How to write a simple bash command

I have a mac mini that has some software that is supposed to start at bootup, but does not always do so.  In order to get the software running I need to open a terminal window and type some commands.  Is it possible to just write a text file and turn it into a .command file that will not require me to write it out every time.
Here is exactly what I have to write in Terminal to get the program running again.
sudo su
filler14
ignition stop
ignition start
exit
exit
Typing sudo su asks for the password which is filler14.  After entering it I type ignition stop and it takes a second and it responds that it stopped.  I type ignition start and it takes about 3 seconds and responds that it is running.  I type exit to get out of sudo su and then exit again and it says operation complete, and then I close terminal.
Is there a way to automate this?
Thanks,
Michael

You need to create a launchd plist for it and put it in the /Library/LaunchDaemons folder. It will run as root on startup.
There are several tutorials all over the web, or you can use Lingon X ($10 probably is too steep for what you want--and likely isn't needed). The App Store version is cheaper, but cannot save directly to the /Library/LaunchDaemons folder due to App Store limitations. However, Peter Borg (developer) notes that you can just create one for your user, then move it to the Library/LaunchDaemons folder yourself.

Similar Messages

  • How to write a simple DB2 client?

    hello,
    I'm going to write a simple DB2 client in my new project,which can issue some simple db2 commands and get the result,for example,the "list tables" command. Can JDBC finish this job?
    any help appreciated.

    JDBC can do that and more.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    %

  • How to write a simple query.

    I have a table where I have data shown below. Now, I want to write a simple query which lists me the project and the count of the distinct effective dates for which data is existant there.
    Sample data:
    Project Task Effective Date (xx_proj_task_data)
    101 T1 01-Jan-2008
    101 T1 01-Feb-2008
    101 T1 01-Mar-2008
    101 T2 01-Jan-2008
    101 T2 01-Apr-2008
    101 T3 01-Apr-2008
    102 T1 01-Jan-2008
    102 T1 01-Feb-2008
    102 T2 01-Apr-2008
    103 T1 01-Jan-2008
    103 T1 01-Feb-2008
    103 T1 01-Mar-2008
    103 T1 01-Apr-2008
    103 T2 01-May-2008
    103 T3 01-Jun-2008
    103 T1 01-Jan-2008
    103 T1 01-Aug-2008
    103 T2 01-Apr-2008
    Output Reqd:
    Project Count(Distinct Effective Dates)
    101 4
    102 3
    103 7
    I can write a query that says:
    select project_id, count(1)
    from (select distinct project_id, effective_date
    from xx_proj_task_data) x
    group by project_id;
    But, is there a way I can achieve the same by avoiding the inner Query (x) and just by a simple query ?
    Thanks!

    Try below query:
    select project_id
    , count(distinct effective_date)
    from xx_proj_task_data
    group by project_id;
    --venkata                                                                                                                                                                                                                                                                                       

  • Use autocomplete in simple bash command/aliases

    I have a really cheesy alias basically to use to cd into directory in public_html
    cdw() {
    cd ~/public_html/$*
    how do I get that to use autocomplete with it?
    Thanks

    you'll have to write a completion file under /etc/bash_completion.d/.  you can take a look at some of the ones in there for examples (try to find a simple one). 
    you basically have to build a list of what to complete (probably ~/public_html/* in your case), then hand that off to a completion function, source the file and try it.

  • How can I send multiple string commands into a VISA write?

    Hi Fellow LabVIEW users
    I am very new to LabVIEW (2.5 months) so please forgive me if my lingo is not up to par.
    How can I send multiple string commands to a VISA write. For example each string command looks like this
    1) 3A00 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0033 (Scenario 1)
    2) 3A01 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0034 (Scenario 2)
    3) 3A01 0000 0000 33FF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0067 (Scenario 3).
    and so on and so forth. And there are a number of scenarios.
    Each String scenario will give a different string output which will be interpreted differently in the front panel.
    Right now I have to manually change the string commands on the front panel to give me the desired output. How can I do this without manually changing the commands i.e. hard coding each scenario into the block diagram?
    Thanks, any feedback will help.
    mhaque

    Please stick to your original post.

  • How to write heading in bold on a simple list?

    On a simple list, I want to write a heading in bold. How to write one in bold?
    Thanks.

    Hello,
    Format intensified on.
    Write: / l_header_text.
    Format intensified off.
    Message was edited by: Cyrill Smirnov

  • How to write data to existing file using spool command?

    Hi,
    I am calling a stored procedure from a shell script. This stored procedure is having a CLOB object as an OUT parameter. How to write the data in CLOB object a existing file which is there in my client system. Below is the shell and sql scripts.
    Shell script
    ( echo "hello" ) > /root/file.txt
    sqlplus -s $user/$pass@$tns @/root/proc.sql /root/file.txt << EOF
    EOFSQL script
    set pages 0
    set trimspool off
    set serveroutput off
    set feedback off
    set term off
    set echo off
    variable out CLOB
    define file='&1'
    begin
    pack.proc(:out);
    end;
    spool &file
    select :out from dual;
    spool offThis code writes contents of the OUT variable to file.txt, but my existing data ('hello') is lost. Please help me.
    I figured the it...Use append in the spool command... :)
    Edited by: Balaji on Jul 19, 2012 8:55 PM

    >
    Hi Balaji
    I figured the it...Use append in the spool command... :Please mark the thread as answered as per the FAQ.
    Paul...

  • How to write "icalcs /deny everyone:(CI)(OI)W" command (on win7) with win xp?

    Hello, i want to know how to write a command like "icacls dir /deny everyone:(CI)(OI)W" on windows xp. Afaik there is no icacls on windows xp, so i guess this should be done with just cacls? I want to lock a folder through cmd, but i cannot manage
    to write a correct command and i don't understand how to use abbrevations with cacls. Could some help me out with converting "icacls dir /deny everyone:(CI)(OI)W" used on w7 to something similar on xp. Also interested in how "/grant"
    transitions on win xp.

    Use cacls :
    https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cacls.mspx?mfr=true
    Rgds
    Milos

  • How to use simple input command ??

    I am tired of trying to find an easy to understand source to implement simple INPUT command ( equivalent to cin>> and scanf() , in c++ and c as i m good in those two)
    when print can be System.out.println(--) , then y does read have to be so complicated ?
    Help me out guys !!!

    package palindrome;
    import java.io.DataInputStream;
    * @author Pulkit
    class Main {
    public static void main(String[] args) {
    int num;
    System.out.println("Enter a number to check if it is palindrome");
    // System.in.readline(num);
    DataInputStream ob = new DataInputStream(System.in);
    Now the remark line is wat i tried to do, as i thought it should follow the print method ( System.out.print ) that one.
    But in a book , i see its done just the other way, just below the rem line.
    I just need ur help to explain me as to how that line has been put, i.e. the syntax of that line.

  • How to write an output of a VI/exe to command line before quitting

    how to write an output of a VI/exe to command line or standard output before exiting the program

    You can use "System Exec.vi" in the Communication pallete. (6.1 and 7.0)
    Daniel L. Press
    PrimeTest Corp.
    www.primetest.com

  • How to write the CMD command for restarting all obi services?

    Hi Experts,
    BIEE:11.1.1.6
    How to write the CMD command for restarting all obi services automatically by windows task scheduler?
    I am try to write the code as below, but it does not work. Please help me to review it and check what I am missing.Thanks.
    Or is there any better method for solving my requirement ? Please share me.Thanks very much.
    cd C:\InstallPath\OBIEE\instances\instance1\bin
    opmnctl stopall
    opmnctl startall
    I am facing the problem that it does not excute the 'opmnctl startall' code, which will be stopped after 'opmnctl stopall',
    So how to modify the command ?Thanks

    See if any of the these are useful or solves your query -
    4.5.2 Using a Windows Service to Start and Stop System Components
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/components.htm#BABEEAAI
    4.5.3 Using the Oracle BI Systems Management API to Programmatically Start and Stop Oracle Business Intelligence
    http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/components.htm#BABFGICA
    Edited by: Abhi on May 8, 2013 4:44 AM

  • How to make htm-file for simple toolbar command?

    Hi
    I am actually tryin to make my own toolbar with commands for Adobe Contribute CS5. A very nice companion for DW sites for endusers to edit the site.
    Creatin toolbars for Contribute and Dreamweaver is the same thats why writig here.
    I have managed to make a toolbar and managed to copy existing commands, like browsing backward and browsing forward, in it, but I have not been able to make my own commands  because I have not been able to figure out how to write the correct javascript into the header of the htm-file.
    I have a set of small predefined html-tables, 15 of them, that user can copypaste into his template generated page, when editing, in order to have some layout order without knowing much of editing with Contribute editor.
    Now, I desperately want to have 15 descriptive buttons in my own toolbar appear when in editing mode. User can choose and click the one he needs, a title1-unit, a title2 unit, a 1-column text unit, 2-column text unit etc. The correctly formatted table enhanced with css-properties appear there where the cursor was positioned. No more copying from one page and pasting to another - much much better this way!
    All I need is htm-file for each of those 15 units. I have not been able to find an example that I could modify.
    Can anyone help. A button (a command) klicked on a toolbar should position the htmltable there where the cursor is - nothing else.
    Htm-files should be positioned here, I think:
    C:\Program Files\Adobe\Adobe Contribute CS5\App\Configuration\Toolbars\MM
    Or is C:\Program Files\Adobe\Adobe Contribute CS5\App\Configuration\Objects\ better?
    Eagerly waiting an answer,
    Kari
    Here is an example of a 1-column unit. All 15 of my units are like this.
    <table border="0" cellpadding="0" cellspacing="0" class="unit1 spacebelow" name="text_1col">
         <tr>
              <td class="txttd unit_pad1_left unit_pad1_right bkgr_check3">
                   <p>Text here</p>
              </td>
              </tr>
    </table>

    This Script works here. Get you the error, when you save or checks the syntax?
    When you use in AppleScript the entry with administrator privileges, is sudo optional. This says only, if everyone can use the sudo command inside of the 5 minutes limit without to write the password again or not.
    The Syntax do shell script "sudo chmod 755 "private/var/spool/cups" password "***" doesn´t work, because you need the entry with administrator privileges for the execution as privileged user.

  • How do I run a snmpwalk/any bash command as a Linux/Unix command (2 state monitor) on a Isilon storage device

    Is there a way that I can run a snmpwalk / isi devices (to find the status of the disk drives in islon) / any Linux bash command using a 2 state monitor Unix/Linux shell command and target a storage device (Isilon in my case) and not target a Unix/Linux
    machine. I tried creating one and it complained saying,
    Is there a way I could run a bash command in my isilon storage and use the ouput to determine the state of the monitor? Please let me know
    Hari V

    For Unix/Linux shell command in Operation Manager to monitor 2 state, you can refer to below link
    http://contoso.se/blog/?p=2680
    http://stefanroth.net/2012/10/21/scom-2012-linux-two-state-monitor-with-script-in-script/
    http://operatingquadrant.com/2012/02/01/opsmgr-2012-unixlinux-authoring-templates-more-information-on-the-shell-command-templates/#more-746
    Please remember, if you see a post that helped you please click (Vote As Helpful" and if it answered your question, please click (Mark As Answer).

  • Accessing Bash Command on Lion OS X.

    Hello Apple Forum Community.  Can anyone help me to understand how you access Bash in Lion (through which Utilities)?  If you are not a professional programmer or developer, is Bash command still worthy of being educated about on your Mac?  A website was describing a Bash command prompt for UNIX passwords; hence, could using Bash to generate and/or organize your passwords be your best bet?  Should we really trust 'random password generator' websites to create UNIX passwords, or are we simply wasting our time if we are really not creating the proper password for our Lion OS X. 
    What other functions can Bash be useful for?  Are there a few simple ways to know and/or get into Bash (to know a few advantageous command prompts) for the general Mac user.  Are any Bash commands different for OS X Lion, or are there new ones as well? Thanks.

    Open Applications->Utilities->Terminal.
    I believe the default shell for at least the last few releases is bash, so you'll get straight to it (though I have mine set to tcsh). If not, just type /bin/bash to start a bash shell.
    Random password generator sites are fine  - all they do is generate a random sequence of characters. However, you're probably going to have to write that password down to remember it, which makes it less secure. Better to come up with a sequence that has some mnemonic meaning to you, that contains uppercase and lowercase letters, numbers and other characters, and is at least eight characters long.
    I doubt there's any need for the "general Mac user" to be using a shell, but if you are interested in programming or getting to know how the OS works "under the hood", then it's worth learning about. There are any number of good resources on the web about UNIX shells.

  • Where can I learn how to write my own Apple Script?

    I am trying to write a script to enable me to schedule email message delivery for a later time for those instances where I'm not around to physically push the send button.  I am leary of downoading scripts written by someone else, for all I know they could be Cc'ing thesmelves on every message I send using their script.
    So, I'd like to write my own.  That is, unless someone has a better and secure way of going about this.
    This is somewhat pressing.  I would appreciate any feedback you can offer.

    There are two parts to your request - generating an email, and sending it on a set schedule.
    Generating an email in AppleScript isn't hard - there are numerous examples online of how to do this, but the scheduling element is the tricky part. There's no built-in task scheduler in AppleScript (other than the simple 'delay' command), which is why people often opt for iCal which can run an AppleScript as part of an event alarm. That can get cumbersome, though, depending on the frequency and volume of emails you're sending.
    There are a few third-party tools such as iDo or PowerManager, so they might be worth checking out. If you want to roll your own you'll need to work out some method of asking the user when a message should be sent and integrating that into your own task manager - not a trivial topic.

Maybe you are looking for