Issue about how to add a block into profile?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Issue about how to add a block into profile?
# 1  
Old 12-09-2008
Issue about how to add a block into profile?

I have to write a rbac script to add something into a role's profile, this script will be executed for many times, during this script, it will add a block into the profile.
if the profile exists, it should check the block has been there, if, just replace it with the latest settings, take an example here:
if [ -r /it/etc/envinit ]; then
. /it/etc/envinit
fi
The block upon should be added into the profile, customer may modify this profile, it must be a strict check that there is no duplicate lines like that settings. How should I do to check that ?

what if there is a blank line or comment line added by customer among that block? what if some spaces added into the lines different as the original?
Can anyone give me some sugguestion?
Thanks a lot.
a2156z
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Add a new user to a vt100 profile

Hello Team, I am trying to add a user a9acd012 and the user has to be added to two groups in unix and two groups in windows, Also i want to give the user vt100 profile when i create the user.Can anyone here help me with the command please.Thanks in advance. (1 Reply)
Discussion started by: Revathi2089
1 Replies

2. UNIX for Advanced & Expert Users

Issue Regarding environment/.profile file

Hi All, I have my own .profile file and environment file. To execute some commands I always need to load some module using module command and change my environment files to project environment file (. /some/project/some/path/init.environ).Without changing my environment file to project file,... (2 Replies)
Discussion started by: saps19
2 Replies

3. Shell Programming and Scripting

.profile issue with UNIX

Hi, There is a user in Solaris-10 zone, ora_big01. Its .profile is not getting executed due to some reason and I am not able to find that. root@trddpd-dwsq04:/# cat /etc/passwd | grep -i ora_big01 ora_big01:x:242349:220:Siebel for QA:/ccq/apps/siebel:/usr/bin/ksh root@trddpd-dwsq04:/# which ksh... (3 Replies)
Discussion started by: solaris_1977
3 Replies

4. AIX

Script to add .profile from one server to all other servers in the network

Hi experts, I am an AIX/Unix admin in my company. I have been asked by one user to distribute .profile from one server to all other servers in the network. This is what she has asked me: "Is there a way for me to save and use one .profile that I have personalized with aliases for all my... (4 Replies)
Discussion started by: uzair_rock
4 Replies

5. Solaris

[solved] Jumpstart Profile Issue

I have created profile file for zfs root (flash) on a wanboot server when i try to validate the rules file with check i get following error .. i 'm not sure why i 'm getting this error .. can any one help me on this ? # ./check Validating rules... Validating profile profile... Error in... (0 Replies)
Discussion started by: fugitive
0 Replies

6. UNIX for Dummies Questions & Answers

Profile execution issue

Hi I have a profile execution issue, I log on to a linux machine , then i do sudo to another user as sudo su - <username> , then <username> .profile executes properly but when I type something I loose all environment varaible and my prompt changes to '$' loosing the PS1 value that I have... (1 Reply)
Discussion started by: malavm
1 Replies

7. Solaris

Profile Issue

when I log into my solaris box, my environment variables are not getting set, and i am getting this error? any ideas? -sh: ORACLE_BASE=/u01/oracle: is not an identifier part of .profile is: export ORACLE_BASE=/u01/oracle export ORACLE_HOME=$ORACLE_BASE/app/products/10.2.0/db_1 ... (6 Replies)
Discussion started by: scorphg
6 Replies

8. Solaris

trying to add .profile for root

I am trying to add a .profile for root I cd to / do vi .profile and get /var/tmp/ExGXaaqa Read only file system... What does this mean? (4 Replies)
Discussion started by: liven
4 Replies
Login or Register to Ask a Question
PMADDPROFILE(3) 					     Library Functions Manual						   PMADDPROFILE(3)

NAME
pmAddProfile - add instance(s) to the current PMAPI instance profile C SYNOPSIS
#include <pcp/pmapi.h> int pmAddProfile(pmInDom indom, int numinst, int *instlist); cc ... -lpcp DESCRIPTION
The set of instances for performance metrics returned from a pmFetch(3) call may be filtered or restricted using an instance profile. There is one instance profile for each context the application creates at the Performance Metrics Application Programming Interface (PMAPI(3)), and each instance profile may include instances from one or more instance domains (see pmLookupDesc(3)). pmAddProfile may be used to add new instance specifications to the instance profile of the current PMAPI context. In the simplest variant, the list of instances identified by the instlist argument for the indom instance domain are added to the instance profile. The list of instance identifiers contains numinst values. The indom value would normally be extracted from a call to pmLookupDesc(3) for a particular performance metric, and the instances in instlist would typically be determined by calls to pmGetInDom(3) or pmLookupInDom(3). To select all instances in all instance domains, use pmAddProfile(PM_INDOM_NULL, 0, (int *)0) This is the only case where indom may be equal to PM_INDOM_NULL. If numinst is zero, or instlist is NULL, then all instances in indom are selected. SEE ALSO
PMAPI(3), pmDelProfile(3), pmFetch(3), pmGetInDom(3), pmLookupDesc(3), pmLookupInDom(3), pmNewContext(3), pmUseContext(3) and pmWhichCon- text(3). DIAGNOSTICS
PM_ERR_PROFILESPEC indom was PM_INDOM_NULL and instlist was not empty CAVEAT
It is possible to add non-existent instance domains and non-existent instances to an instance profile. None of the routines that use the instance profile will ever issue an error if you do this. The cost of checking, when checking is possible, outweighs any benefits. Performance Co-Pilot PCP PMADDPROFILE(3)