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.

Recommended Answers

All 3 Replies

Ah thanks, buried under Tech Talk. Will I get busted if I repost over there? :-)

probably not. just mark this one as solved. you could always ask a mod and they will move the thread though

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.