User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Legacy and Other Languages section within the Software Development category of DaniWeb, a massive community of 456,428 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,602 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 1079 | Replies: 3 | Solved
Reply
Join Date: May 2005
Posts: 229
Reputation: nathanpacker is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

little shell scripting help here...

  #1  
Jul 18th, 2007
Hey, I didn't see a forum for shell scripting, so I hope this is the place to put it. As part of my new job, I'm learning a little shell scripting, working on an HP-UX system.

I'm trying to automate a user account creation process, and I need to access the template file that SAM uses so I can set certain attributes of the user's account, according to the template file. (I know, why not just use SAM? That's the same question I asked my boss, ask him. I don't know.)

Here is a sample of the template file, called /var/sam/ug/templates/ts:

handle 1 {
list UG_TS_UT 1 {
UG_TS_UT {
UG_TS_UT_TITLE = "MyTemplate";
UG_TS_UT_DESC = "User of MyTemplate";
UG_TS_UT_HDPATH = "/home";
UG_TS_UT_SUP = "/bin/tcsh";
UG_TS_UT_PGRP = "users2";
UG_TS_UT_ALTSTR = NULL;
UG_TS_UT_BOOTSU = "NO";
UG_TS_UT_PWDFSGP = "DFT";
UG_TS_UT_PWDFSGC = "DFT";
UG_TS_UT_PWDFSGL = "DFT";
UG_TS_UT_PWDFUSP = "DFT";
UG_TS_UT_PWDFERR = "DFT";
UG_TS_UT_PWDFNUL = "DFT";
UG_TS_UT_PWDFLEN = -1;
UG_TS_UT_PGID = 108;
UG_TS_UT_UIDVAL1 = NULL;
UG_TS_UT_UIDVAL2 = NULL;
UG_TS_UT_LOGENV = NULL;
UG_TS_UT_UIDMETH = 1;
UG_TS_UT_INCCOM = 1;
UG_TS_UT_ACCACT = 1;
UG_TS_UT_ALTTYPE = 1;
UG_TS_UT_ACCLFTM = -1;
UG_TS_UT_MAXPOI = -1;
UG_TS_UT_UNSUCLT = -1;
UG_TS_UT_PWDAGING = -1;
UG_TS_UT_PWDTBC = -1;
UG_TS_UT_PWDEXPT = -1;
UG_TS_UT_PWDWARN = -1;
UG_TS_UT_PWDLFTM = -1;
UG_TS_UT_PWDOPT = 2;
UG_TS_UT_CRHD = 1;
UG_TS_UT_PSD = 1;
};
};
};

Now, if any of you use HP-UX, you'll know that SAM uses the parameters set in this file to create user accounts according to this template, which is called "MyTemplate".

But how can I use these parameters? They don't look like variables, because you can't have spaces before or after the equal sign with variables. So what is this type of script called, and how can I call it in my script to use those values?

sorry this is long, I hope I made sense.
Last edited by nathanpacker : Jul 18th, 2007 at 12:04 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2005
Location: Dundee, Scotland
Posts: 12,883
Reputation: jbennet is just really nice jbennet is just really nice jbennet is just really nice jbennet is just really nice 
Rep Power: 32
Solved Threads: 304
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: little shell scripting help here...

  #2  
Jul 18th, 2007
TRY MY SUGGESTIONS AT YOUR OWN RISK

Master of puppets Im pulling your strings, blinded by me, you cant see a thing. Master! Master!
Reply With Quote  
Join Date: May 2005
Posts: 229
Reputation: nathanpacker is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: little shell scripting help here...

  #3  
Jul 18th, 2007
Ah thanks, buried under Tech Talk. Will I get busted if I repost over there? :-)
Reply With Quote  
Join Date: Apr 2005
Location: Dundee, Scotland
Posts: 12,883
Reputation: jbennet is just really nice jbennet is just really nice jbennet is just really nice jbennet is just really nice 
Rep Power: 32
Solved Threads: 304
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: little shell scripting help here...

  #4  
Jul 18th, 2007
probably not. just mark this one as solved. you could always ask a mod and they will move the thread though
TRY MY SUGGESTIONS AT YOUR OWN RISK

Master of puppets Im pulling your strings, blinded by me, you cant see a thing. Master! Master!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Legacy and Other Languages Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Legacy and Other Languages Forum

All times are GMT -4. The time now is 1:18 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC