Results 1 to 4 of 4
  1. #1

    Member Since
    May 14, 2012
    Help making shell script for basic command
    I need to make a shell script for a command to create aliases for 500 folders in 500 parent directories. I've found one page that was useful (, however I need to put the aliases on several computers, and once the aliases made with that script are off my computer, the aliases are "dead," due to rights permissions, I assume.

    The command works when I copy and paste the commands one by one into Terminal, but I'd rather not do that.

    Example of folder structure
    .............person2/ etc.

    Example of command being used
    ln -s "/Volumes/server/people/person1" /shortcuts/

    Thanks for any help.

  2. #2

    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    27" i7 iMac, 15" Macbook Pro TB, 13" Macbook Air, iPhone 6S, iPod Nano 7th Gen
    On Linux (that's what I have access to right now) something like this would work
    for dir in `find /Volumes -mindepth 3`; do
        ln -s "$dir " /shortcuts/
    The mindepth here ensures that you get the "server/people/personX" level. Without that, you end up getting "server" and "server/people" as well which you probably don't want.

    If mindepth is supported by OS X's "find", then this script should work..

  3. #3

    Member Since
    May 14, 2012
    Thanks, I see what you're getting at there, but that line of code didn't work. Here's a site with how OS X uses mindepth. Any suggestions how to change it to work? Thanks.

  4. #4

    Member Since
    May 14, 2012

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. FTP Shell Script Q.
    By edwardlscott in forum macOS - Operating System
    Replies: 8
    Last Post: 03-06-2013, 01:37 AM
  2. Shell script help
    By Hyper in forum macOS - Development and Darwin
    Replies: 12
    Last Post: 05-22-2011, 11:36 AM
  3. Terminal -- shell script -- script will only read two lines of a file
    By Straitsfan in forum macOS - Apps and Games
    Replies: 0
    Last Post: 01-30-2011, 09:04 PM
  4. Making a Shell Script Executable
    By surfwax95 in forum macOS - Development and Darwin
    Replies: 10
    Last Post: 08-25-2010, 04:15 PM
  5. help with basic shell scripting
    By jrcal in forum macOS - Development and Darwin
    Replies: 0
    Last Post: 06-11-2007, 12:08 PM

Posting Permissions

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