Find the answer to your Linux question:
Results 1 to 2 of 2
Hello- I'm trying to develop the ability to do command line program migrations in Mac OS X. I would like to be able to read a file, in this case ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    15

    Command Line Migration Assistant

    Hello-

    I'm trying to develop the ability to do command line program migrations in Mac OS X. I would like to be able to read a file, in this case Mail.pkg, and have a script that copies the application and any support files elsewhere on the drive to another computer.

    I think the syntax should be something like:

    Code:
    #!/bin/sh
    for file in `lsbom $1/Contents/Archive.bom`
    do
    cp "$file" "$2"
    done
    And then the command line:

    Code:
    $ sh script.sh /Library/Reciepts/Mail.pkg /Volumes/OtherHDD
    I need someway to tell my script to copy the file and the directories it should be in without overwriting possible existing directories. I thought that was -R, but when I use -R I get all of the files in the root directory. I'm trying to copy a program and all of its required resources from someone's old computer to their new computer - like Migration Assistant in OS X. I know there is an easy way to make this happen on the command line.

    Any help would be greatly appreciated! Thank you for your time.

    -= robbie =-

  2. #2
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    I think raising the -i flag on your cp command does what you need.

Posting Permissions

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