Solved

Batch File Equivalent in OS X Terminal?

Posted on 2013-12-31
3
1,288 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
Comment Utility
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 27

Expert Comment

by:serialband
Comment Utility
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
Comment Utility
Cool stuff. Thanks guys!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Create a default user profile for Mac OS X 10.7/10.8 Create a user account on OS X that will be a template for every other user of that computer. I usually call it “profile” and make it an administrator account for the time being. 1. Install a…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now