[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Batch File Equivalent in OS X Terminal?

Posted on 2013-12-31
3
Medium Priority
?
1,486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
lruiz52 earned 1120 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 30

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

There is a security feature on iOS devices that is nearly impenetrable when it has been activated.  This article will provide some possible solutions as well as necessary steps to take to ensure you do not end up with a locked device.
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

649 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