Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.
So, running OS X 10.6.7 with SABnzbd+. I am trying to make a script and have not had any luck doing it. I know it is a very simple task, but for some reason by bash-fu isn't strong with this script.

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

Any help is GREATLY appreciated!

Edit: I have tried this and several slight variations to this. The weird thing is, "$1" shows the path, $DIR_DEST echoes /Users/Crush/Desktop/, and when running the same thing in Terminal.app as separate commands, it works fine. The strange thing is the script always wants to complain saying something along the lines of "/Users/Crush/Download/Linux ISO/* /Users/Crush/Desktop/*" does not exist, when they in fact do.

code:
#!/bin/bash

DIR_DEST=${HOME}/Desktop/

mv "$1/*" $DIR_DEST

Crush fucked around with this message at 02:18 on May 16, 2011

Adbot
ADBOT LOVES YOU

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.

FISHMANPET posted:

I think that when you're putting the first parameter in quotes, it's not going to expand that *, so it's literally looking for a file named * in the Linux ISO directory. Try putting the quotes around just $1.

This was it. I love you. Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply