Results 1 to 5 of 5
  1. #1

    Member Since
    Sep 30, 2012
    mac terminal run a file of commands
    I am coming from Linux and trying to get a Mac to do what I want it to do. The question is what is the best tool to use. I want to mount (unmount) several remote disks. If I go into a terminal I can do the trick by

    mount -t smbfs //username:pass@addr /Users/me/RemoteDisks/mnt1

    Since I want to mount several disks I would like to put all of the information into a file, store it in Documents/subfolder and make a link to it on the desktop (or somewhere better, if there is a better place). At the moment I have manually run the appropriate command in the terminal and the remote disk is mounted and I see its contents. What I need is a one click method to run a file to mount all the disks.

    I tried Apple script but that didn't like my commands. I don't know exactly what it is expecting to see and perhaps Apple script is the wrong tool. I have no problems in Linux, but the Mac is new to me and I don't know what I should be using.

    Thanks, Ilan

  2. #2

    louishen's Avatar
    Member Since
    Oct 22, 2007
    Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
    You need to write it up in a text editor and save it as a shell script

    You can then create an application from the script

    Platypus | Sveinbjorn Thordarson
    Member of the Month September 2008 & August 2012 | Found advice useful? use the rep system

  3. #3

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Early 2015 13" rMBP
    The "do shell script" command in Applescript should do the trick here. Take a look here. Put a few of those in a file for each mount and save it as an application.

    A simple example:
    do shell script "mount -t smbfs //username:pass@addr /Users/me/RemoteDisks/mnt1"
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  4. #4

    Member Since
    Sep 30, 2012
    Thanks. do shell script looks like it will do the trick. I had tried it with just the part inside the quotes and that doesn't work.

  5. #5

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Groves, Texas
    21in. iMac 10.11 --- HP Linux Mint 18
    Quote Originally Posted by louishen View Post
    Thanks for that, looks interesting.
    Any priest or shaman must be presumed guilty until proved innocent.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mac OS X Fun Terminal Commands
    By bgranttech in forum macOS - Operating System
    Replies: 0
    Last Post: 07-19-2012, 10:41 AM
  2. Making an interface to run a php file in Terminal
    By juniorj23 in forum iOS and Apps
    Replies: 2
    Last Post: 06-09-2012, 02:42 PM
  3. Run Terminal commands outside application?
    By Corbab in forum macOS - Operating System
    Replies: 1
    Last Post: 11-24-2009, 02:11 PM
  4. i need to run a couple of terminal commands at starup
    By tero2008 in forum macOS - Development and Darwin
    Replies: 3
    Last Post: 03-19-2008, 07:31 AM
  5. Multiple partitions in Mac - Run these commands
    By missileh in forum macOS - Operating System
    Replies: 0
    Last Post: 02-20-2008, 01:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts