Solved

Batch File Equivalent in OS X Terminal?

Posted on 2013-12-31
3
1,345 Views
Last Modified: 2014-02-03
What's the equivalent to a MS DOX Batch file in the OS X Terminal? What's the file extension to a batch file equivalent?
0
Comment
Question by:jdana
3 Comments
 
LVL 17

Accepted Solution

by:
lruiz52 earned 280 total points
ID: 39749428
The equivalent to a dos batch file would be a shell script with a .sh extension.

You would have to make the file executable by running;

chmod 755 scriptname.sh

Then running it like this;

bash scriptname.sh
0
 
LVL 29

Expert Comment

by:serialband
ID: 39752590
If you want to make it clickable in the finder, it should be renamed with the .command extension.

While you can run bash scriptname.sh on a bash script file, you generally want to make the first line of the bash file  #!/bin/bash so that you can run it from the local path as ./scriptname.sh.  If you put the script in your defined path, you can just run it as scriptname.sh  The .sh isn't even necessary except for you to easily spot them when you list the files.  The chmod 755 command is actually what makes it executable in linux/unix.  If you don't run the chmod command, then you do need to call bash scriptname.sh.
0
 

Author Closing Comment

by:jdana
ID: 39831068
Cool stuff. Thanks guys!
0

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
A common question or need, when setting-up a new Mac for someone would be to make all of the applications, installed, available from the dock. Many people often do not realize an application is installed unless it is in the dock. Creating a custo…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question