[GLLUG] Good shell script tutorial?

Mike Szumlinski szumlins at mac.com
Tue Jan 11 15:30:26 EST 2005


Primarily because I know less than nothing about Perl.  I'm sure I 
could do it in PHP or maybe even Applescript, but I figured simple 
shell scripting comes in handy, especially when building deployment 
systems.  This was just the first task at hand.  Ultimately, I'm 
writing a setup engine for my new Mac clones so that they do a variety 
of things including the following:

1)Name the computer
2) Create a server directory (if one doesn't already exist) for their 
home
3) Bind the computer to Active Directory
4) modify the names of some files on the HD to match what they need to 
be
5) send the serial number, asset tag number, username, user phone, and 
date to a MySQL db upon running the setup

I'm sure I can use a handful of different languages to do this...maybe 
I'm attacking it the wrong way?

Right now I have 1 and 3 being done in Applescript.  I have a canned 
script to accomplish 4 that I need to modify, but its a shell script.  
5 is just a matter of collecting information, parsing it, and then 
sending it via a URL to a php page on my asset server. 2 is still a bit 
of a kludge in my head.

-Mike

On Jan 11, 2005, at 3:01 PM, Edward Glowacki wrote:

> Just out of curiosity, any particular reason for sh+curl to input 
> stuff into a database instead of using something like perl (or python 
> , etc.) to directly connect to the database and do your input that 
> way?  Perl is just about as ubiquitous as sh these days, and I know it 
> has database modules for pretty much everything.  Even without the 
> database modules, it still might prove better for munging data 
> together and sending it out across the network (still using curl if 
> you so desire).
> As far as SH references, I assume the O'Reilly books are good.  If can 
> somehow look like you're coming from MSU, you should be able to access 
> safari.oreilly.com and read through some books online there (otherwise 
> you have to pay for access I think).



More information about the linux-user mailing list