Need help with simple script for OS X

Come up with a useful post-processing script? Share it here!
Post Reply
Crush
Newbie
Newbie
Posts: 15
Joined: May 8th, 2010, 1:46 am

Need help with simple script for OS X

Post by Crush »

Hello! I am looking to make a simple script for OS X to move all files out of a folder and into a different folder.

For example: Say I download something, it finishes and it unpacks to a directory called "Ubuntu 11 04." Inside of this folder, is the actual burnable image file. I want to move that burnable image file to the Desktop and then delete the folder "Ubuntu 11 04." How do I go about doing this?

Any help is GREATLY appreciated!
Crush
Newbie
Newbie
Posts: 15
Joined: May 8th, 2010, 1:46 am

Re: Need help with simple script for OS X

Post by Crush »

Someone else helped me out on a different forum. Here is what I am currently using if anyone was interested.

Code: Select all

#!/bin/bash

DIR_DEST=${HOME}/Movies/
DIR_TRASH=${HOME}/.Trash/

mv -f "$1"/* $DIR_DEST && mv -fv "$1" $DIR_TRASH
imthenachoman
Jr. Member
Jr. Member
Posts: 59
Joined: March 2nd, 2009, 10:58 am
Contact:

Re: Need help with simple script for OS X

Post by imthenachoman »

Did you figure it out?
Crush wrote:Hello! I am looking to make a simple script for OS X to move all files out of a folder and into a different folder.

For example: Say I download something, it finishes and it unpacks to a directory called "Ubuntu 11 04." Inside of this folder, is the actual burnable image file. I want to move that burnable image file to the Desktop and then delete the folder "Ubuntu 11 04." How do I go about doing this?

Any help is GREATLY appreciated!
Crush
Newbie
Newbie
Posts: 15
Joined: May 8th, 2010, 1:46 am

Re: Need help with simple script for OS X

Post by Crush »

Yep. My 2nd post contains the code I currently use.

Edit: I see my wording was ambiguous in my 2nd post. The code in that post is what I was ultimately looking for.
Post Reply