Solved

Batch File Equivalent in OS X Terminal?

Posted on 2013-12-31
3
1,300 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 28

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mac OS 10.5.8 and Citrix Receiver 3 304
OS X Proxy Exception Setting Script 3 130
MacBook Pro won't boot to recovery or Mac OS Install disc 11 3,735
Gestures Back & Forward (Folders) 2 61
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:   …
This article describes in detail how to set up the iPad in the Enterprise using iPCU aka iPhone Configuration Utility.  This could also be used for the iPhone although I have not detailed out any differences. Preparation as an iPad Administrator:…
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.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 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

12 Experts available now in Live!

Get 1:1 Help Now