Operating System - HP-UX
1825759 Members
2166 Online
109687 Solutions
New Discussion

Re: how to handle the the request response file variables in configure script ..

 
Raisaab
Advisor

how to handle the the request response file variables in configure script ..

Hello to everyone.

Friends I have the following query ...

I am able to generate a response file after executing a request file with swask. But the problem is when i use those variables in configure script of my package,some how the configure script is not able to recognize it and the operation fails. So would like to know about specific way to pass the variables values collected in response file to the configure script of a package. These variable values i use in my configure script to create user, group and home directory.

My request file :-
echo " Please type the name of User to be used with this package"
read USER
echo $USER >> ${SW_CONTROL_DIRECTORY}response

echo " Please type the name of Patrol Group to be used with this package"
read GROUP
echo $GROUP >> ${SW_CONTROL_DIRECTORY}response

echo " Please type the home directory "
read HOMEDIR
echo $HOMEDIR >>${SW_CONTROL_DIRECTORY}response

The response file i get after giving the values ...
# file response
response: awk program text
# cat response
Vijay
Vijay
/home/export/Vijay
( Although, the doc suggest it should be in
var=value format for SVR4 )

The configure script ...
cat /etc/group | cut -f1 -d':' | grep $GROUP
if [ $? != 0 ]; then
msg NOTE " Adding group, since it's not there"
groupadd $GROUP
msg NOTE " Now adding user after adding group "
useradd -m -d $HOMEDIR -g $GROUP $USER
else
msg NOTE " Group Already exists, adding user $USER
useradd -m -d $HOMEDIR -g $GROUP $USER
msg NOTE " $USER added successfully "
fi

But when i do swinstall the problem is it is not able to understand $GROUP $USER $HOMEDIR variable values ... Any speific way to do ...

Appreciate your time and help on the same.
8 REPLIES 8
RAC_1
Honored Contributor

Re: how to handle the the request response file variables in configure script ..

your_script < "response_file"
There is no substitute to HARDWORK
Muthukumar_5
Honored Contributor

Re: how to handle the the request response file variables in configure script ..

what is the option you have tried with swinstall?

Use like,

# swinstall -s -x ask=as_needed

It will check for response files if it is not there then run request scripts.

hth.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: how to handle the the request response file variables in configure script ..

See this:

http://docs.hp.com/en/B2355-90740/ch11s05.html?btnNext=next%A0%BB

Answers should be written to the response file in env_var=value format so that the response files can be easily used by other control scripts.


echo " Please type the name of User to be used with this package"
read USER
echo "USER=$USER" >> ${SW_CONTROL_DIRECTORY}response

echo " Please type the name of Patrol Group to be used with this package"
read GROUP
echo "GROUP=$GROUP" >> ${SW_CONTROL_DIRECTORY}response

echo " Please type the home directory "
read HOMEDIR
echo "HOMEDIR=$HOMEDIR">>${SW_CONTROL_DIRECTORY}response

Try it.
Easy to suggest when don't know about the problem!
Raisaab
Advisor

Re: how to handle the the request response file variables in configure script ..

Muthu,
I have tried swinstall -s -x ask=as_needed option ... it creates response file either you go by swask way or swinstall way but the values of the response file i need them in my configure script ...
and yes in the doc i have read earlier the contents of the response file should be
var=val format but in my response file i get only the values ... that is why i have given the response file
Thanks for time ...
Muthukumar_5
Honored Contributor

Re: how to handle the the request response file variables in configure script ..

Try to change your script as prev. reply and try out. Is it working?

hth.
Easy to suggest when don't know about the problem!
Raisaab
Advisor

Re: how to handle the the request response file variables in configure script ..

Request you to be more specific ...
The control script ( configure ) in my case is a part of a fileset which is used to create a product with swpackage. So after creating the swpackage/depot, i have only the option of swask or swinstall to create response files with the request script in the fileset. Once i have the response file, than my configure script should know how to get values from the response file for the variables read in the corresponding request file, and further use them for creating user or group as described in config file i have pasted. So basically, i need to pass the variable values in the config script from the one present in response file.
Raisaab
Advisor

Re: how to handle the the request response file variables in configure script ..

My last response was to RAC ...
Apology for missing the name while addressing to you RAC.
Raisaab
Advisor

Re: how to handle the the request response file variables in configure script ..

Thanks for your help.
I cleared this problem by writing a awk script which takes input from response file and feeds to the config script.
Thanks every one.