How to run commands from the Terminal from the Finder?

I would ask a series of Terminal commands in a file, then run the commands by double-clicking on the file in the Finder.  I found a number of sources on how to do on the internet, but most include comments from other users by saying: "this has not worked for me.  I have not found a definitive 'it's how

I created a test file, use TextEdit, named test.commandand saved to my desktop.  The file contains these commands:

! / bin/sh

chmod + x ~/Desktop/test.command

echo 'Hi. ' here

echo 'Hi' once again

When I double-click the file, however, it sometimes just opened in the Finder.  Other times, I get an error message saying I don't have permission to run the file.  I thought that the chmod command was to manage the authorization, but maybe I'm not using it correctly.

Can anyone help?

#! / bin/sh

You must # follow-up by the! as the very first 2 characters of the file.

And as bash is the default shell, you should probably actually tell

#! / bin/bash

The chmod + x command should be performed after you have created the file test.command, not inside her.

Another way to run shell commands is via Automator-> run the Shell Script

Automator has no need to open a Terminal Services session to process orders.  But if you want to have the command display something, it might be simpler to use a .command file, although there are ways to view things in an Automator app as well.

Tags: Mac OS & System Software

Similar Questions

  • How to run SQRW outside the process scheduler

    Hi all

    on the 8.53 on Win 2008 Server, MSSQL DB server, tools how to run SQRW outside the process scheduler?

    Thank you.

    To run a QAS on the client:

    1. Select Start, run, click Browse and navigate to PS_HOME\bin\sqr\MSS\binw.

    Select sqrw.exe and click Open.

  • How to run sqlplus from the server

    Hello

    I have 11g installed on a Linux server by someone.
    Could you please help me know...
    -How to create a development in there environment?
    -How to start SQLPlus not my local machine, but directly by the server?
    -How to run any .sql decompressed in the server files?

    For your information, I don't know anything on the server and database.

    Thank you
    Guy

    Link: Apex 3.1.1 installation / upgrade can help you.

  • How to run VI in the background and save system resources

    Hello

    I want to develop an application (pc, windows 7) that checks the line port DSR series every 100 MS basically, I know how to create a VI that works with serial ports using VISA drivers. My request or my VI must be invisible to the user, and a variable DSR everytime level incrementing counter is high.

    What is the best way to create a VI that runs in the background (invisible to the user, not even shown minimized in the taskbar). Given that the application needs to run most of the time, when the pc is running, I don't want to use too much computer resources (cpu, memory on an average desktop pc). The user should be able to work with other applications like ms office, during execution of the VI in the background.

    LabVIEW is appropriate create a background VI which periodically checks the serial port and consumes system resources minimum or are languages like c ++ much better suited to save system resources? What is the best way to create an invisible VI that is running in the background?

    Thank you very much for your help!

    Tom

    On any modern hardware, the difference in the use of resources among a LabVIEW application and written in C++ for a simple task like this will be minimal. Anyway that you use a fraction of the time CPU available if the application is written correctly.

    To run an invisible VI in the background, see user-defined execution of a LabVIEW Application as Windows Service.

  • How to run commands inside a virtual machine?

    Hey,.

    I train hard run commands inside a machine virtual on vSphere (batch scripts) and could not find a good way to do it,

    in ESX 3.5 "vmrun.exe" did the job, but it does not work on vSphere for some reason any.

    I also tried to do with PowerCLI but could not find any help for this command.

    Am I missing something?

    Maybe my syntax of the command is wrong and someone can give me the proper syntax?

    Im sure there is a way to do it and would appreciate any help that anyone can give me.

    Thank you very much in advance,

    Omer

    vmrun must work with vSphere, in fact, vSphere is the only version of ESX that vmrun (and the VIX API, on which is built vmrun) officially supports. ESX 3.5 is only experimental support.

    Please make sure you have the latest version of VIX installed; You can find it at www.vmware.com/go/vix.

    Once you have installed, if you still see an error, please post what this error is and what kind of host you are using vmrun.

  • How to run script on the web using HTTP web page?

    Hi guys

    Please let me know how to execute script on the web using HTTP web page?

    Concerning
    Frank

    Hi Jos,

    ODI provides web-based UI to run scenarios using metadata (read only your components ODI) Navigator and designer Lighweight (you can change the mapping here).

    If please review how to install the metadata browser in ODI and take a look at the document ODI Setup for more information.

    Thank you
    Guru

  • How to turn command of the CSA approval?

    Hello

    I have GBA 4.1 for Windows!

    I test Cisco6513 of authorization of a user command.

    The problem is that the switch is allowing the orders that I denied GBA for that particular user.

    I enclose the screenshots.

    Can someone tell me what I'm missing? Should I put some certain commands in 6513 to activate command of the CSA approval?

    My switch to ACS config is:

    AAA new-model

    AAA server Ganymede group + name1

    Server ACSserver1

    !

    AAA authentication login default group local name1

    enable AAA, activate the default authentication group name1

    AAA authorization exec default group name1 authenticated by FIS

    aaa IP http authentication

    radius-server ACSserver1 host

    done - no radius-server request

    RADIUS-server key xxxxx

    These commands, you are missing

    AAA authorization commands 1 default group Ganymede + authenticated if

    AAA authorization commands 15 default group Ganymede + authenticated if

    AAA authorization config-commands

    Kind regards

    ~ JG

    Note the useful messages

  • How to run Photoshop from Adobe manager

    Photoshop CS6 is indicated as being installed in the Adobe Manager, but there is no launch button to open the program.  I click on Photoshop CS6, but nothing happens.

    Check your Start menu / Applications folder as for any other program.

    Mylenium

  • How to run DBMS_HS_PASSTHROUGH with the name of the variable database link?

    Hello

    I want to run some native sql through DBMS_HS_PASSTHROUGH of oracle to sybase.
    but the name of the database link is variable, from things as below:
    BEGIN DBMS_HS_PASSTHROUGH. OPEN_CURSOR@db_link_name;

    where db_link_name is a local variable and pl/sql still communicate compile error.

    Have experience with this?

    Thank you.

    Rock
    INTO l_cursor
    

    I think you mean...

    USING OUT l_cursor
    
  • How to run packages in the order of the sequences/ODI11g

    Hello
    I developed 10 package and I want to run these packages in order, one by one.
    When 1 package done that should start automatically 2 package when it finished then should start 3 package and package of 10.


    Concerning
    Sher

    Hello

    Generate a script for each of the 10 package.
    Then create another packet saying MAIN_PACKAGE
    Place 1 package scenario then the scenario of the 2nd package and so not until the 10th scenario package
    Join 1e-2e from line OK and will continue a 10th.

    When you run the whole package your child MAIN_PACKAGE (package1, package2,... package10) will be executed in a sequence provided no child package fails. In the case of any breach your execution stop there only.

    Thank you
    Fati

  • Engine bar planning tasks has stopped working. How to run again is the question.

    To my knowledge I have nothing to cause this.  It just started one day.

    Hi Swallen56,

    1. When you receive the error message?

    Method 1:

    I suggest that you restart the Scheduler on the computer service and check if it works.

    a. Click Start type services.msc in the Search box, and then click OK.

    b. in the Services (Local) list, click Task Scheduler.

    c. right-click on the service and click on restart

    d. close the services window and restart the computer, check if it works.

    Method 2:

    It is possible that some third-party programs installed on the computer is causing the problem.

    I suggest that you perform a clean boot and check.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    After the troubleshooting steps, please see the link to boot is a way of putting your computer to normal startup mode.

    Hope this information is useful.

  • How to add commands to the context menu for the types of files (add associations)?

    I would like to download anime and re - encode standard dvd (mpeg2) format before you burn it to a DVD for better quality.  I have a program suite that supports the grunt work, but to do a contextual menu command that calls the original batch file that the user must manually add it to the menu of context by file association.  I found that I can access the menus of file associations, but the option to add a new association with an existing file type does not seem to exist.  Is there a registry entry, I need to change or add to allow me to customize my context menus in Windows 7?

    Create a text file (make sure you have the framework where you DO NOT hide known file extensions unmarked)

    Change the new text file... Copy the following: [quote]

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\WMP11. AssocFile.AVI\shell\Queue for encoding]
    @= "& Queue for encoding.

    [HKEY_CLASSES_ROOT\WMP11. AssocFile.AVI\shell\Queue for Encoding\command]
    "@="c:\\dvdstudio\\scripts\\Queue.bat \"%1\"

    [HKEY_CLASSES_ROOT\WMP11. AssocFile.MP4\shell\Queue for encoding]
    @= "& Queue for encoding.

    [HKEY_CLASSES_ROOT\WMP11. AssocFile.MP4\shell\Queue for Encoding\command]
    "@="c:\\dvdstudio\\scripts\\Queue.bat \"%1\"

    [HKEY_CLASSES_ROOT\CCCP. WMP. AssocFile.MKV.1\shell\Queue for encoding]
    @= "& Queue for encoding.

    [HKEY_CLASSES_ROOT\CCCP. WMP. AssocFile.MKV.1\shell\Queue for Encoding\command]
    "@="c:\\dvdstudio\\scripts\\Queue.bat \"%1\"

    [/ quote]

    Save the text file..., rename the text file with the .reg extension

    Double-click the new registry file to add the context menu commands to your registry... everything is done! :)

    And thank you very much, BluePlateSpecial!

  • How to define commands and the default view

    I have Acrobat 9 Standard, and I want to set the default to open files to view full page with one-page-at-a-time of scrolling.  I regularly open multiple PDF files and have to scroll through the entire document.

    I managed to get the full view page to work, but does not scroll the entire page.  Currently, when I open the document, the mouse scroll the document continuously wheel several rows at a time.  What I want is for the mouse wheel to scroll through the document to a full page at a time (page up/page down).  I can manually set it by selecting the 'Full Page' button on the toolbar (the one with the four arrows), but it is another step, I have to every time I open a document.

    Is it possible to put the scrolling in full screen by default?

    You must put once the file PDF is loaded. You may need to edit document properties in some cases (use ctrl-D). I say this, but it seems that using one link to another location in the document resets the display properties based on the document. In this case, you will need to change the properties of the document (if available).

  • How to run the packaged procedure with Ref Cursor

    Hello.
    The question may be very simple for you... but I was confused how to run
    I have the following package
    CREATE OR REPLACE PACKAGE CURSPKG AS 
        TYPE T_CURSOR IS REF CURSOR; 
        PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER, 
                                   IO_CURSOR IN OUT T_CURSOR); 
        
    END CURSPKG;
    / 
    
    
    CREATE OR REPLACE PACKAGE BODY CURSPKG AS
        PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,
                                   IO_CURSOR IN OUT T_CURSOR)
        IS 
            V_CURSOR T_CURSOR; 
        BEGIN 
            IF N_EMPNO <> 0 
            THEN
                 OPEN V_CURSOR FOR 
                 SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                      FROM EMP, DEPT 
                      WHERE EMP.DEPTNO = DEPT.DEPTNO 
                      AND EMP.EMPNO = N_EMPNO;
    
            ELSE 
                 OPEN V_CURSOR FOR 
                 SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                      FROM EMP, DEPT 
                      WHERE EMP.DEPTNO = DEPT.DEPTNO;
    
            END IF;
            IO_CURSOR := V_CURSOR; 
        END OPEN_ONE_CURSOR; 
    
        
    END CURSPKG;
    /
    But I want to test (run) this procedure...
    But confused how to have Ref Cursor
    Could you help me in this...

    Thank you

    You must declare a variable of type T_CURSOR and pass it to the procedure like this.

    declare
      lOutCursor CURSPKG.T_CURSOR;
    begin
      CURSPKG.OPEN_ONE_CURSOR(, lOutCursor);
    end;
    
  • How can I get run command Wizard in windows 7

    How can I get run command Wizard in windows 7

    Help & Support:

    That became the command run?

    The run command no longer appears on the start menu in this version of Windows. The search box that appears in the start menu provides much of the same functionality as the command run. However, the command run is still available if you prefer to use. You can even add it to the start menu for easier access.

    To add the run command to the start menu
    Click to open the taskbar and Start Menu Properties.

    Click the Start Menu tab, and then click Customize.

    In the list of options on the start menu, select the command box run and then click OK. Run the command will appear on the right side of the start menu.

    Tip:
    You can also access the command run by pressing the logo Windows + R key.

Maybe you are looking for