[GRLUG] bash scripting help

topher at t1kdevelopment.com topher at t1kdevelopment.com
Sun Jul 18 15:45:11 EDT 2010


This is only kind of bash scripting help.  Mostly I need help referring to 
other programs properly.  Here's what I want to do.

There's a new user on my machine, and I want to get a new wordpress 
package and unpack it in their dir.  Getting it is easy,
wget http://wordpress.org/latest.tar.gz

That would drop that tarball in the dir in which I'm running the script, 
right?  I'm ok with that.

Since I don't have perms on the other user's account, I'll be running this 
script as root.

So, once the file is in my home dir, I want to unpack it.  man tar tells 
me this should work:

tar xvzf latest.tar.gz -C ~username/public_html

Does that make sense?

Then I can set permissions on that new stuff, and remove latest.tar.gz

A couple questions:

Will my script wait until my wget is done before trying to do the next 
thing, or should I pause for a while?

Is -C the best way to unpack it in a remote dir, or is there a better way 
to specify a destination?



Topher

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list